[PATCH v2 0/1] MR2254: vbscript/tests: Fix the testChrError() tests.
v2: Fixed a typo in the commit message. -- v2: vbscript/tests: Fix the testChrError() tests. https://gitlab.winehq.org/wine/wine/-/merge_requests/2254
From: Francois Gouget <fgouget(a)codeweavers.com> Chr() depends on the thread's ANSI code page which in some cases is different from the Windows ANSI code page (e.g. hi-IN). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54003 --- dlls/vbscript/tests/run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index 4158aa28197..294b635ea41 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -239,7 +239,7 @@ static void detect_locale(void) PRIMARYLANGID(GetUserDefaultUILanguage()) == LANG_ENGLISH && PRIMARYLANGID(GetUserDefaultLangID()) == LANG_ENGLISH); - GetCPInfoExA( CP_ACP, 0, &cpinfo ); + GetCPInfoExA( CP_THREAD_ACP, 0, &cpinfo ); MaxCharSize = cpinfo.MaxCharSize; GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK | LOCALE_RETURN_NUMBER, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2254
Do we need to change something in implementation as well to match this? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2254#note_25145
This merge request was closed by Francois Gouget. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2254
Actually it's vbscript:run itself which decides on the code page. More specifically it implements the GetLCID() method which returns GetUserDefaultLCID(), and that's why VBScript_SetScriptSite() initializes the interpreter with a code page that matches the CP_THREAD_ACP code page (the code path is pretty different but as far as I can tell it resolves to the same in the end). That said, even if our test did not implement the GetLCID() method, then VBScript_SetScriptSite() would also default to GetUserDefaultLCID() so we'd still end up with the same code page. So I don't think we need to modify the implementation. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2254#note_25193
participants (3)
-
Francois Gouget -
Francois Gouget (@fgouget) -
Nikolay Sivov (@nsivov)