mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-14 08:01:38 +01:00
Don't assume resources aren't utf-8 because current dict isn't.
Always assuming they're utf-8 seems to work, so do that for now. Fixes problems with Catalan messages when using English dict.
This commit is contained in:
parent
ad2ba1c249
commit
cdf418b904
1 changed files with 2 additions and 3 deletions
|
@ -42,7 +42,6 @@ stuffTextInField( HWND hDlg, StrBoxState* state )
|
||||||
XP_UCHAR* sbuf;
|
XP_UCHAR* sbuf;
|
||||||
wchar_t* wbuf;
|
wchar_t* wbuf;
|
||||||
CEAppGlobals* globals = state->dlgHdr.globals;
|
CEAppGlobals* globals = state->dlgHdr.globals;
|
||||||
UINT codePage = ceCurDictIsUTF8(globals)? CP_UTF8 : CP_ACP;
|
|
||||||
|
|
||||||
sbuf = XP_MALLOC( globals->mpool, nBytes + 1 );
|
sbuf = XP_MALLOC( globals->mpool, nBytes + 1 );
|
||||||
stream_getBytes( state->stream, sbuf, nBytes );
|
stream_getBytes( state->stream, sbuf, nBytes );
|
||||||
|
@ -53,9 +52,9 @@ stuffTextInField( HWND hDlg, StrBoxState* state )
|
||||||
}
|
}
|
||||||
sbuf[nBytes] = '\0';
|
sbuf[nBytes] = '\0';
|
||||||
|
|
||||||
len = MultiByteToWideChar( codePage, 0, sbuf, nBytes, NULL, 0 );
|
len = MultiByteToWideChar( CP_UTF8, 0, sbuf, nBytes, NULL, 0 );
|
||||||
wbuf = XP_MALLOC( globals->mpool, (len+1) * sizeof(*wbuf) );
|
wbuf = XP_MALLOC( globals->mpool, (len+1) * sizeof(*wbuf) );
|
||||||
MultiByteToWideChar( codePage, 0, sbuf, nBytes, wbuf, len );
|
MultiByteToWideChar( CP_UTF8, 0, sbuf, nBytes, wbuf, len );
|
||||||
XP_FREE( globals->mpool, sbuf );
|
XP_FREE( globals->mpool, sbuf );
|
||||||
wbuf[len] = 0;
|
wbuf[len] = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue