Re: [cmake-developers] [PATCH v2] Improve encoding handling on Windows

2016-07-05 Thread Brad King
On 07/03/2016 09:22 AM, Dāvis Mosāns wrote: > Huge thanks for review! Will fix mentioned issues in next version of patch. > Also I'll implement this solution with std::streambuf as it's much better way > and it's actually not that much work I thought it would be. Yes, thanks Mike! Dāvis, in the

Re: [cmake-developers] [PATCH v2] Improve encoding handling on Windows

2016-07-03 Thread Dāvis Mosāns
2016-07-03 13:04 GMT+03:00 Mike Gelfand : > For std::c(in|out|err) vs. std::wc(in|out|err), here's an implementation > of std::streambuf which we currently use in our projects: > http://stackoverflow.com/a/21728856/583456. You could either try using > it as is or use it as a

Re: [cmake-developers] [PATCH v2] Improve encoding handling on Windows

2016-07-03 Thread Mike Gelfand
For std::c(in|out|err) vs. std::wc(in|out|err), here's an implementation of std::streambuf which we currently use in our projects: http://stackoverflow.com/a/21728856/583456. You could either try using it as is or use it as a base for your own implementation; in any case, it's better than forcing

[cmake-developers] [PATCH v2] Improve encoding handling on Windows

2016-07-02 Thread Dāvis Mosāns
On Windows getenv (and putenv) uses ANSI codepage so it needs to be encoded to internally used encoding (eg. UTF-8). Here we use _wgetenv (and _wputenv) instead and encode that. Also typically Windows applications (eg. MSVC compiler) use current console's codepage for output to pipes so we need