|
|
#11 | |
|
Junior Member
Join Date: Apr 2007
Location: Seltz, France
Posts: 46
|
New Unicode.dll
Quote:
int WideCharToMultiByte( __in UINT CodePage, __in DWORD dwFlags, __in LPCWSTR lpWideCharStr, __in int cchWideChar, __out LPSTR lpMultiByteStr, __in int cbMultiByte, __in LPCSTR lpDefaultChar, __out LPBOOL lpUsedDefaultChar ); According to Microsoft's documentation WideChar2MultiByte should return the BufferSize needed if parameter cbMultiByte is 0, i always got 0. So to convert a file to UTF-8 I make the buffer as large as the inputfile (Unicode-16) and if the function returns "ERROR_INSUFFICIENT_BUFFER" I reallocate the buffer with double the size and repeat. I hope It will be of use. Axel |
|
|
|
|
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|