diff options
author | 2018-12-28 21:18:07 +0200 | |
---|---|---|
committer | 2019-01-22 12:59:23 +1300 | |
commit | b0afca5815ed7ad11693745474124440a51b48a9 (patch) | |
tree | 2b6aa9ef4345fb21da91e8aebb50469bd0603354 /tests/testqml.h | |
parent | a5a191e8502ff7e078c92e41c2b078db5abdfab9 (diff) | |
download | subsurface-b0afca5815ed7ad11693745474124440a51b48a9.tar.gz |
windows.c: fix wrong usage of wcslen() for utf8 conversation
wcslen() returns the number of characters in a wchar_t string.
In the case of WideCharToMultiByte() an estimate for the size of
the utf8 buffer is needed. Using wcslen() is incorrect for such a buffer,
because for any non-ASCII character the estimate will be off by 1 byte.
Call the following instead to obtain the proper UTF8 buffer size
for the conversation:
WideCharToMultiByte(CP_UTF8, 0, utf16, -1, NULL, 0, NULL, NULL);
Also fix some missing "\n" in fprintf() calls.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'tests/testqml.h')
0 files changed, 0 insertions, 0 deletions