mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-26 09:58:20 +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
0d326c0252
commit
ad2ba1c249
4 changed files with 7 additions and 12 deletions
|
@ -2835,8 +2835,7 @@ ceStreamToStrBuf( MPFORMAL XWStreamCtxt* stream )
|
|||
static int
|
||||
ceOops( CEAppGlobals* globals, const XP_UCHAR* str )
|
||||
{
|
||||
XP_Bool isUTF8 = ceCurDictIsUTF8( globals );
|
||||
return ceMessageBoxChar( globals, str, isUTF8,
|
||||
return ceMessageBoxChar( globals, str,
|
||||
ceGetResStringL( globals, IDS_FYI_L ),
|
||||
MB_OK | MB_ICONHAND );
|
||||
}
|
||||
|
@ -2854,8 +2853,7 @@ messageBoxStream( CEAppGlobals* globals, XWStreamCtxt* stream,
|
|||
XP_UCHAR* buf = ceStreamToStrBuf( MPPARM(globals->mpool) stream );
|
||||
int result;
|
||||
|
||||
result = ceMessageBoxChar( globals, buf, ceCurDictIsUTF8(globals),
|
||||
title, buttons );
|
||||
result = ceMessageBoxChar( globals, buf, title, buttons );
|
||||
|
||||
XP_FREE( globals->mpool, buf );
|
||||
return result;
|
||||
|
@ -3636,8 +3634,7 @@ ce_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi,
|
|||
snprintf( msgBuf, VSIZE(msgBuf), fmt, wordsBuf );
|
||||
|
||||
if ( turnLost ) {
|
||||
XP_Bool isUTF8 = ceCurDictIsUTF8( globals );
|
||||
ceMessageBoxChar( globals, msgBuf, isUTF8,
|
||||
ceMessageBoxChar( globals, msgBuf,
|
||||
ceGetResStringL( globals, IDS_ILLEGALWRD_L ),
|
||||
MB_OK | MB_ICONHAND );
|
||||
isOk = XP_TRUE;
|
||||
|
|
|
@ -362,7 +362,6 @@ PrefsDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
ceMessageBoxChar( globals,
|
||||
ceGetResString( globals,
|
||||
IDS_NEED_TOUCH ),
|
||||
XP_FALSE,
|
||||
ceGetResStringL( globals,
|
||||
IDS_FYI_L ),
|
||||
MB_OK | MB_ICONHAND );
|
||||
|
|
|
@ -1063,17 +1063,16 @@ ceGetPath( CEAppGlobals* globals, CePathType typ,
|
|||
|
||||
int
|
||||
ceMessageBoxChar( CEAppGlobals* XP_UNUSED(globals), const XP_UCHAR* str,
|
||||
XP_Bool isUTF8, const wchar_t* title, XP_U16 buttons )
|
||||
const wchar_t* title, XP_U16 buttons )
|
||||
{
|
||||
HWND parent;
|
||||
/* Get the length required, then alloc and go. This is technically
|
||||
correct, but everywhere else I assume a 2:1 ratio for wchar_t:char. */
|
||||
XP_U16 clen = 1 + strlen(str);
|
||||
UINT codePage = isUTF8? CP_UTF8:CP_ACP;
|
||||
XP_U32 wlen = 1 + MultiByteToWideChar( codePage, 0, str, clen, NULL, 0 );
|
||||
XP_U32 wlen = 1 + MultiByteToWideChar( CP_UTF8, 0, str, clen, NULL, 0 );
|
||||
wchar_t widebuf[wlen];
|
||||
|
||||
MultiByteToWideChar( codePage, 0, str, clen, widebuf, wlen );
|
||||
MultiByteToWideChar( CP_UTF8, 0, str, clen, widebuf, wlen );
|
||||
|
||||
parent = GetForegroundWindow();
|
||||
return MessageBox( parent, widebuf, title, buttons );
|
||||
|
|
|
@ -48,7 +48,7 @@ void ceGetItemRect( HWND hDlg, XP_U16 resID, RECT* rect );
|
|||
void ceMoveItem( HWND hDlg, XP_U16 resID, XP_S16 byX, XP_S16 byY );
|
||||
|
||||
int ceMessageBoxChar( CEAppGlobals* globals, const XP_UCHAR* str,
|
||||
XP_Bool isUTF8, const wchar_t* title, XP_U16 buttons );
|
||||
const wchar_t* title, XP_U16 buttons );
|
||||
XP_Bool ceCurDictIsUTF8( CEAppGlobals* globals );
|
||||
|
||||
XP_U16 ceDistanceBetween( HWND hDlg, XP_U16 resID1, XP_U16 resID2 );
|
||||
|
|
Loading…
Reference in a new issue