http://bugs.winehq.org/show_bug.cgi?id=22001
Summary: datetime.c test fails when LC_CTYPE="ru_RU.UTF-8" Product: Wine Version: 1.1.40 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: testcases AssignedTo: wine-bugs@winehq.org ReportedBy: b7.10110111@gmail.com
Here's the output:
comctl32_test.exe.so datetime.c && touch datetime.ok datetime.c:679: Test failed: Expected 3/10/2010, got 10.03.2010 make[1]: *** [datetime.ok] Error 1
If i set LC_CTYPE=en_US, the test passes.
Here are my locale settings:
$ locale LANG=en_US LC_CTYPE=ru_RU.UTF-8 LC_NUMERIC="en_US" LC_TIME="en_US" LC_COLLATE="en_US" LC_MONETARY="en_US" LC_MESSAGES="en_US" LC_PAPER="en_US" LC_NAME="en_US" LC_ADDRESS="en_US" LC_TELEPHONE="en_US" LC_MEASUREMENT="en_US" LC_IDENTIFICATION="en_US" LC_ALL=
"3/10/2010" is en_US format, while "10.03.2010" is ru_RU, this means that it's the test bug since it expects a string in other format than LC_CTYPE specifies.
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #1 from Ruslan b7.10110111@gmail.com 2010-03-10 09:25:53 --- Hmm.. just took a look at the test source. It seems that not test is defective, but datetime control is. The date strings are compared one from WM_GETTEXT on datetime control, and another one (correct) from GetDateFormat.
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #2 from Nikolay Sivov bunglehead@gmail.com 2010-03-10 09:55:12 --- Created an attachment (id=26731) --> (http://bugs.winehq.org/attachment.cgi?id=26731) Use user locale for date format
First of all I'm not sure that setting LC_CTYPE only is a proper way to do, but still, try this patch, it wouldn't hurt.
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #3 from Ruslan b7.10110111@gmail.com 2010-03-10 10:50:20 --- (In reply to comment #2)
First of all I'm not sure that setting LC_CTYPE only is a proper way to do, but still, try this patch, it wouldn't hurt.
It works OK now.
http://bugs.winehq.org/show_bug.cgi?id=22001
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Component|testcases |comctl32 Ever Confirmed|0 |1
--- Comment #4 from Vitaliy Margolen vitaliy@kievinfo.com 2010-03-10 21:17:18 --- Confirming.
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #5 from Nikolay Sivov bunglehead@gmail.com 2010-03-11 07:56:44 --- Ruslan, what distro are you running?
http://bugs.winehq.org/show_bug.cgi?id=22001
Andrew Nguyen arethusa26@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |toralf.foerster@gmx.de
--- Comment #6 from Andrew Nguyen arethusa26@gmail.com 2010-03-11 07:57:40 --- *** Bug 22007 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #7 from Ruslan b7.10110111@gmail.com 2010-03-11 08:08:10 --- (In reply to comment #5)
Ruslan, what distro are you running?
LFS 6.3
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #8 from Toralf Förster toralf.foerster@gmx.de 2010-03-12 02:26:56 --- (In reply to comment #3)
Toralf, it's definitely a duplicate, please post your 'locale' output.
tfoerste@n22 ~ $ locale LANG= LC_CTYPE=de_DE.utf8 LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL=
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #9 from Nikolay Sivov bunglehead@gmail.com 2010-03-12 03:55:10 --- Honestly I have mixed feelings about that. It seems that we should use LOCALE_USER_DEFAULT for format strings any way, same time I don't know how the following:
--- LANG= LC_CTYPE=de_DE.utf8 --- LANG=en_US LC_CTYPE=ru_RU.UTF-8 ---
should be properly handled in Wine. Let's wait for some experienced opinion here, questions are:
- what LC_*/LANG locale data part has priority to set system/user locale in Wine; - is there a way to check that control uses system locale in Windows? Is there a way to alter system locale bits in Windows to see difference?
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #10 from Austin English austinenglish@gmail.com 2010-03-12 11:08:12 --- You could detect the system locale and bail out for non-English/expected locales. See for example advapi32/tests/security.c: http://source.winehq.org/git/wine.git/?a=blob;f=dlls/advapi32/tests/security...
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #11 from Nikolay Sivov bunglehead@gmail.com 2010-03-12 11:13:39 --- (In reply to comment #10)
You could detect the system locale and bail out for non-English/expected locales. See for example advapi32/tests/security.c: http://source.winehq.org/git/wine.git/?a=blob;f=dlls/advapi32/tests/security...
No, I don't care about a test to properly fail. What I want is to know is there a way to check on Windows what locale specifier does control use for format. For example what is system default locale in Windows - all I found is that it's dependent on Windows localization version. Could I change system default locale data to check how control will react?
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #12 from Ruslan b7.10110111@gmail.com 2010-03-12 12:49:10 --- (In reply to comment #11)
Could I change system default locale data to check how control will react?
If i understood you correctly, you can use "Control Panel" -> "Language and reginal options" setup page for this.
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #13 from Nikolay Sivov bunglehead@gmail.com 2010-03-12 13:04:19 --- (In reply to comment #12)
(In reply to comment #11)
Could I change system default locale data to check how control will react?
If i understood you correctly, you can use "Control Panel" -> "Language and reginal options" setup page for this.
Isn't it per user settings?
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #14 from Ruslan b7.10110111@gmail.com 2010-03-12 13:15:45 --- (In reply to comment #13)
Isn't it per user settings?
It is. But why would this matter?
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #15 from Nikolay Sivov bunglehead@gmail.com 2010-03-12 13:27:20 --- (In reply to comment #14)
(In reply to comment #13)
Isn't it per user settings?
It is. But why would this matter?
Because LOCALE_SYSTEM_DEFAULT and LOCALE_USER_DEFAULT are different things. With your partially changed locale data:
--- LANG=en_US LC_CTYPE=ru_RU.UTF-8 ---
system and user locale data are different in Wine, that's why test failed.
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #16 from Alexandre Julliard julliard@winehq.org 2010-03-13 12:43:51 --- Most likely the datetime control should be using LOCALE_USER_DEFAULT throughout, currently it seems to be using a mix of both.
http://bugs.winehq.org/show_bug.cgi?id=22001
--- Comment #17 from Nikolay Sivov bunglehead@gmail.com 2010-03-13 13:00:18 --- (In reply to comment #16)
Most likely the datetime control should be using LOCALE_USER_DEFAULT throughout, currently it seems to be using a mix of both.
Yes, it isn't consistent now and I'll patch it. Am I right there's no way to alter LOCALE_SYSTEM_DEFAULT data on Windows?
http://bugs.winehq.org/show_bug.cgi?id=22001
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #18 from Nikolay Sivov bunglehead@gmail.com 2010-03-15 12:55:46 --- Fixed by commit b1b54ae39f912de0f7c02f544f85c569cd03d185.
http://bugs.winehq.org/show_bug.cgi?id=22001
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #19 from Alexandre Julliard julliard@winehq.org 2010-03-19 14:11:06 --- Closing bugs fixed in 1.1.41.
http://bugs.winehq.org/show_bug.cgi?id=22001
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |b1b54ae39f912de0f7c02f544f8 | |5c569cd03d185