
On Mon, May 28, 2012 at 3:33 PM, Artyom Beilis <artyomtnk@yahoo.com> wrote:
[...] The library provides an implementation of standard C and C++ library functions such that their inputs are UTF-8 aware on Windows without requiring using Wide API to make program work on Windows.
Hi, I'm happy that this is getting to be proposed to boost. My comments: * I find the way you handle the main() arguments elegant. * I don't like that the convert function is overloaded for both narrow and wide conversions. Rationale: Consider the following real-world scenario: // Some existing overloaded function, like std::fstream constructor on dinkumware void f(const std::string &s); // 3rd party 'ANSI' codepage void f(const std::wstring &s); // 3rd party 'UNICODE' std::string str = get_utf8_string(); f(convert(str)); // we want to call the wide string version Now during development we may change it to: std::wstring str = get_string_from_windows(); // we changed only this line f(convert(str)); // and forgot to change this one. oops... Solution: This is an error that can be caught at compile time, we just have to state the intent clearly. Use alternative names? (narrow/widen) Cheers, -- Yakov