All dict strings are utf8, so don't ever convert using CP_ACP. Fixes

misdisplay of Spanish Ñ in tray and on board.
This commit is contained in:
ehouse 2009-10-23 08:56:43 +00:00
parent 6aca59abe0
commit ab853ffb3b

View file

@ -515,7 +515,7 @@ ceBestFitFont( CEDrawCtx* dctx, const XP_U16 soughtHeight,
makeTestBuf( dctx, sample, VSIZE(sample), index ); makeTestBuf( dctx, sample, VSIZE(sample), index );
len = 1 + strlen(sample); len = 1 + strlen(sample);
wlen = MultiByteToWideChar( dctx->codePage, 0, sample, len, wlen = MultiByteToWideChar( CP_UTF8, 0, sample, len,
widebuf, len ); widebuf, len );
memBM = CreateCompatibleBitmap( memDC, testHeight, testHeight ); memBM = CreateCompatibleBitmap( memDC, testHeight, testHeight );
@ -1048,7 +1048,7 @@ DRAW_FUNC_NAME(drawCell)( DrawCtx* p_dctx, const XP_Rect* xprect,
} else if ( !isDragSrc && !!letters && (letters[0] != '\0') ) { } else if ( !isDragSrc && !!letters && (letters[0] != '\0') ) {
wchar_t widebuf[4]; wchar_t widebuf[4];
MultiByteToWideChar( dctx->codePage, 0, letters, -1, MultiByteToWideChar( CP_UTF8, 0, letters, -1,
widebuf, VSIZE(widebuf) ); widebuf, VSIZE(widebuf) );
ceDrawTextClipped( hdc, widebuf, -1, XP_FALSE, fce, xprect->left+1, ceDrawTextClipped( hdc, widebuf, -1, XP_FALSE, fce, xprect->left+1,
xprect->top+2, xprect->width, DT_CENTER ); xprect->top+2, xprect->width, DT_CENTER );
@ -1176,7 +1176,7 @@ drawDrawTileGuts( DrawCtx* p_dctx, const XP_Rect* xprect,
if ( !!bitmaps || !!letters ) { if ( !!bitmaps || !!letters ) {
HFONT oldFont = SelectObject( hdc, fce->setFont ); HFONT oldFont = SelectObject( hdc, fce->setFont );
XP_U16 wlen = MultiByteToWideChar( dctx->codePage, 0, letters, XP_U16 wlen = MultiByteToWideChar( CP_UTF8, 0, letters,
-1, widebuf, VSIZE(widebuf) ); -1, widebuf, VSIZE(widebuf) );
/* see if there's room to use text instead of bitmap */ /* see if there's room to use text instead of bitmap */