"Anatoly Lyutin" vostok@etersoft.ru wrote:
--- dlls/kernel32/tests/locale.c 5 Jan 2007 19:37:02 -0000 1.8 +++ dlls/kernel32/tests/locale.c 24 Jan 2007 14:15:14 -0000 @@ -35,6 +35,9 @@ #include "winerror.h" #include "winnls.h"
+#include "locale.h" +#include "tables_CP1251.h"
I'd suggest to test specific strings instead of auto-generated tables. Since microsoft apparently uses their own unicode tables that differ from unicode.org ones that's almost impossible to get the exactly same behaviour among Wine and Windows.
+static int compare_string2_non_latin(const void *e1, const void *e2) +{
- const char *s1 = (char *)e1;
- const char *s2 = (char *)e2;
- return CompareStringA(LOCALE_USER_DEFAULT,0,s1,1, s2,1) - 2;
+}
You need to directly specify the locale id, otherwise the test won't pass on a system with different user default locale (like the Alexandre's one).
Dmitry Timoshkov wrote:
"Anatoly Lyutin" vostok@etersoft.ru wrote:
--- dlls/kernel32/tests/locale.c 5 Jan 2007 19:37:02 -0000 1.8 +++ dlls/kernel32/tests/locale.c 24 Jan 2007 14:15:14 -0000 @@ -35,6 +35,9 @@ #include "winerror.h" #include "winnls.h"
+#include "locale.h" +#include "tables_CP1251.h"
I'd suggest to test specific strings instead of auto-generated tables. Since microsoft apparently uses their own unicode tables that differ from unicode.org ones that's almost impossible to get the exactly same behaviour among Wine and Windows.
Unfortunately there are programs which are using this table of sorting and no other.
+static int compare_string2_non_latin(const void *e1, const void *e2) +{
- const char *s1 = (char *)e1;
- const char *s2 = (char *)e2;
- return CompareStringA(LOCALE_USER_DEFAULT,0,s1,1, s2,1) - 2;
+}
You need to directly specify the locale id, otherwise the test won't pass on a system with different user default locale (like the Alexandre's one).
In:
+ + while(Locales[j].pcTable) + { + if(setlocale(LC_ALL,Locales[j].pcLocalName)!=NULL) + { + for(i=0;i<cSize;i++)
set another locale, isn't it?
"Anatoly Lyutin" vostok@etersoft.ru wrote:
I'd suggest to test specific strings instead of auto-generated tables. Since microsoft apparently uses their own unicode tables that differ from unicode.org ones that's almost impossible to get the exactly same behaviour among Wine and Windows.
Unfortunately there are programs which are using this table of sorting and no other.
We can do nothing to fix the apps calling CompareStringA for binary data. The only way would be to patch unicode.org tables manually, but it's not acceptable as a general solution.
Anyway you need to test the specific cases, and not add a blanket (all in one) case IMO.
- return CompareStringA(LOCALE_USER_DEFAULT,0,s1,1, s2,1) - 2;
+}
You need to directly specify the locale id, otherwise the test won't pass on a system with different user default locale (like the Alexandre's one).
In:
- while(Locales[j].pcTable)
- {
if(setlocale(LC_ALL,Locales[j].pcLocalName)!=NULL)
{
for(i=0;i<cSize;i++)
set another locale, isn't it?
This doesn't magically change Wine internal locale used by CompareStringA.