-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to not use wchar/wstring on windows? #239
Comments
If you're using only ASCII and a specific code page (ANSI) then the conversion looks unnecessary. But it's still required if you want UTF-8 logs. There is no conversion path ANSI-->UTF-8 available, so you have to use a longer path ANSI-->WCHAR-->UTF-8. So With other OSes the situation is different. |
I strongly disagree there. UTF-8 everywhere is the way to go. Yes, OS system calls needs to use plog needs a mode where it |
@dgrunwald UTF-8 everywhere has drawbacks on Windows:
IMHO you'll have more pain than gain using such approach on Windows. However YMMV, for your case it could be a good option. I'm adding support for such mode. Luckily it doesn't require a lot of changes. |
This is an existing, decades-old multi-platform codebase. I can't change it's unicode strategy without a massive multi-year conversion project (which no sane person would attempt). Also, all third-party libraries we've used so far have been compatible with this approach (by default! without having to enable "a mode"). plog was the first library giving us trouble. For now we've forked plog and replaced the occurrences of |
@dgrunwald Recently I worked with sentry and their library uses |
This allows to use http://utf8everywhere.org approach.
This allows to use http://utf8everywhere.org approach.
@nuuSolutions I've added support for Utf8Everywhere. Just compile your project with |
First up, I like the simplicity of this.
I'm on windows, but I always try to avoid using
wchar_t
orwstring
etc.There is the PLOG_ENABLE_WCHAR_INPUT flag, but setting it to 0 does nothing but prevent direct use of
L"Hello"
internally you still use
std::wstring
andstd::wostringstream
(as far as I understand)I'm worried about the conversions that silently happen - they are just not necessary
Maybe you assume that's what windows users want, but it's not always the case.
The text was updated successfully, but these errors were encountered: