2 ms·
Can anyone elucidate whether the new UTF-8 codepage allows working with filenames that aren’t valid UTF-16 (i.e. containing mismatched surrogate code points)?
by layer8 5y ago
Can anyone elucidate whether the new UTF-8 codepage allows working with filenames that aren’t valid UTF-16 (i.e. containing mismatched surrogate code points)?
In general I think it’s best to stick with the native "W" functions and/or wchar_t on Windows.
- ChrisSD 5y agoIt does not. Invalid UTF-16 (aka unpaired surrogates) are replaced by the Unicode REPLACEMENT_CHARACTER (�) However, in practice such filenames are only produced by malicious software and many large products won't work with them anyway (e.g. Microsoft's own VSCode).