Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix MultiByte <-> WideChar conversion return value on linux
MultiByteToWideChar/WideCharToMultiByte are supposed to include/exclude null termination based on whether the source string buffer is null terminated. This was done by comparing the input byte/wide character count to the output byte/wide character count excluding null termination. This only works correctly if the input only consists of ASCII characters. (ie. only characters that are single byte in UTF-8) This commit changes the code to explicitly check for a null terminator in the input and add one to the output size if the input was terminated.
- Loading branch information