kenlm icon indicating copy to clipboard operation
kenlm copied to clipboard

char [ ]”convert to “LPCWSTR” erro on windows

Open tqangxl opened this issue 8 years ago • 2 comments

file.cc (Fixed it )

(Fixed it ---> add #undef UNICODE before #include <windows.h> )

#if defined(MINGW32) #undef UNICODE #include <windows.h> #include <unistd.h> #warning "The file functions on MinGW have not been tested for file sizes above 2^31 - 1. Please read https://stackoverflow.com/questions/12539488/determine-64-bit-file-size-in-c-on-mingw-32-bit and fix" #elif defined(_WIN32) || defined(_WIN64) #undef UNICODE #include <windows.h> #include <io.h>

tqangxl avatar May 19 '17 02:05 tqangxl

Ugh I guess that will make things compile. But it really should be converting from UTF-8 to legacy UTF-16 to support legacy Windows API calls with proper unicode file name support.

https://msdn.microsoft.com/magazine/mt763237

kpu avatar May 19 '17 10:05 kpu

http://utf8everywhere.org/

kpu avatar May 19 '17 10:05 kpu