http://bugs.winehq.org/show_bug.cgi?id=9490
Summary: LOCALE_IFIRSTDAYOFWEEK is 0 by default, instead of current locale value Product: Wine Version: CVS/GIT Platform: Other OS/Version: other Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: wine-kernel AssignedTo: wine-bugs@winehq.org ReportedBy: peter@cendio.se
Unless the user has manually tweaked the "iFirstDayOfWeek" registry key, GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, ...) always returns zero, which means Sunday, even though the locale on the system indicates otherwise. The effect is that month calendar controls, for example, starts the week with sunday rather than, say, monday, which is the ISO standard and common in many countries.
The current locale standard can be fetched with two nl_langinfo calls. I don't really understand enough of kernel32/locale.c to make the necessary modifications, though.
http://bugs.winehq.org/show_bug.cgi?id=9490
--- Comment #1 from Peter Åstrand peter@cendio.se 2007-08-27 10:12:40 --- Created an attachment (id=7830) --> (http://bugs.winehq.org/attachment.cgi?id=7830) Example code which demonstrates fetching first weekday from locale
One problem might be that many systems have broken locale information, and thus indicates that the week should start with a saturday. Nevertheless, the GNOME project has taken the decision that the locale information can be trusted. If GNOME can depend on this, I think Wine can as well.
http://bugs.winehq.org/show_bug.cgi?id=9490
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID
--- Comment #2 from Dmitry Timoshkov dmitry@codeweavers.com 2007-08-28 01:35:37 --- Wine has its own locale data base, which matches what Windows has. Have a look at dlls/kernel32/nls. Unless you have a test case which shows that GetLocaleInfo behaves differently under Wine and Windows this bug is invalid.
http://bugs.winehq.org/show_bug.cgi?id=9490
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Dmitry Timoshkov dmitry@codeweavers.com 2007-08-28 01:36:04 --- Closing.
http://bugs.winehq.org/show_bug.cgi?id=9490
Peter Åstrand peter@cendio.se changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |UNCONFIRMED Resolution|INVALID |
--- Comment #4 from Peter Åstrand peter@cendio.se 2007-08-28 04:14:58 --- The original report might have been a little confusing, sorry about that. I'm not saying that GetLocaleInfo is incorrect; I'm saying that the value of iFirstDayOfWeek in the registry should be created automatically with a default value fetched from the current locale, just as sLanguage, sCountry, iCurrency and many other parameters are. Example: If I delete my .wine and runs Wine with LANG=sv_SE, I get this in user.reg:
"iCalendarType"="1" "iCountry"="46" "iCurrDigits"="2" "iCurrency"="3" "iDate"="2" "iDigits"="2" "iLDate"="1" "iLZero"="1" "iMeasure"="0" "iNegCurr"="8" "iTime"="1" "iTimePrefix"="0" "iTLZero"="1" "LC_CTYPE"="0000041d" "LC_MEASUREMENT"="0000041d" "LC_MONETARY"="0000041d" "LC_NUMERIC"="0000041d" "LC_TELEPHONE"="0000041d" "LC_TIME"="0000041d" "Locale"="0000041d" "Numshape"="1" "s1159"="" "s2359"="" "sCountry"="Sweden" "sCurrency"="kr" "sDate"="-" "sDecimal"="," "sLanguage"="Swedish" "sList"=";" "sLongDate"="'den 'd MMMM yyyy" "sNativeDigits"="0123456789" "sShortDate"="yyyy-MM-dd" "sThousand"="\xa0" "sTime"=":"
If I do the same with LANG=C, I get:
[Control Panel\International] 1188292115 "iCalendarType"="1" "iCountry"="1" "iCurrDigits"="2" "iCurrency"="0" "iDate"="0" "iDigits"="2" "iLDate"="0" "iLZero"="1" "iMeasure"="1" "iNegCurr"="0" "iTime"="0" "iTimePrefix"="0" "iTLZero"="0" "LC_CTYPE"="00000409" "LC_MEASUREMENT"="00000409" "LC_MONETARY"="00000409" "LC_NUMERIC"="00000409" "LC_TELEPHONE"="00000409" "LC_TIME"="00000409" "Locale"="00000409" "Numshape"="1" "s1159"="AM" "s2359"="PM" "sCountry"="United States" "sCurrency"="$" "sDate"="/" "sDecimal"="." "sLanguage"="English (United States)" "sList"="," "sLongDate"="dddd, MMMM dd, yyyy" "sNativeDigits"="0123456789" "sShortDate"="M/d/yyyy" "sThousand"="," "sTime"=":"
So clearly, the principle is that the default values are fetched from the current system locale, and surely it makes sense to include iFirstDayOfWeek as well? If this aint a bug, it's at least a feature request.
http://bugs.winehq.org/show_bug.cgi?id=9490
Alexandre Julliard julliard@winehq.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #5 from Alexandre Julliard julliard@winehq.com 2007-08-28 07:52:57 --- Should be fixed by http://source.winehq.org/git/wine.git/?a=commit;h=2e55b3d6ab16de0923c8ebad60...
http://bugs.winehq.org/show_bug.cgi?id=9490
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Dmitry Timoshkov dmitry@codeweavers.com 2007-08-28 08:41:46 --- Closing as FIXED.
http://bugs.winehq.org/show_bug.cgi?id=9490
--- Comment #7 from Peter Åstrand peter@cendio.se 2007-08-29 03:28:59 --- I can confirm that the patch works correctly. The definition of LOCALE_IFIRSTDAYOFWEEK in sve.nls is incorrect, though. I will send a patch to the mailing list for this.
http://bugs.winehq.org/show_bug.cgi?id=9490
--- Comment #8 from Dmitry Timoshkov dmitry@codeweavers.com 2007-08-29 04:12:08 ---
I can confirm that the patch works correctly. The definition of LOCALE_IFIRSTDAYOFWEEK in sve.nls is incorrect, though. I will send a patch to the mailing list for this.
XP SP2 fully up to date returns LOCALE_IFIRSTDAYOFWEEK=0 for swedish locale (0x041d), and that matches what Wine returns. There is no need for a patch.
http://bugs.winehq.org/show_bug.cgi?id=9490
--- Comment #9 from Peter Åstrand peter@cendio.se 2007-08-29 09:27:43 ---
XP SP2 fully up to date returns LOCALE_IFIRSTDAYOFWEEK=0 for swedish locale (0x041d), and that matches what Wine returns.
Oh, thanks for pointing this out. I've confirmed that LOCALE_IFIRSTDAYOFWEEK/iFirstDayOfWeek indeed uses 0=monday etc; this is documented on MSDN as well.
Nevertheless, the month calendar control is not behaving correctly. For some unknown reason, it uses 0=sunday etc. Here's a comment from monthcal.c:
/* sets the first day of the week that will appear in the control */ /* 0 == Sunday, 6 == Saturday */
But MSDN clearly indicates that the API should use 0=monday, see http://msdn2.microsoft.com/en-us/library/ms670423.aspx.
Should I open another bug for the problem with the month calendar control, or reopen this one?
http://bugs.winehq.org/show_bug.cgi?id=9490
--- Comment #10 from Dmitry Timoshkov dmitry@codeweavers.com 2007-08-29 09:56:21 --- I'd suggest to open a new bug.
http://bugs.winehq.org/show_bug.cgi?id=9490
--- Comment #11 from Peter Åstrand peter@cendio.se 2007-08-31 03:07:59 --- I've now created bug 9532 for the month calendar control problem.
http://bugs.winehq.org/show_bug.cgi?id=9490
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|CVS/GIT |unspecified