Patches item #3560801, was opened at 2012-08-22 13:19
Message generated for change (Comment added) made by earnie
You can respond by visiting:
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Group: Patch needs review
Submitted By: George Koehler (kernigh)
>Assigned to: Earnie Boyd (earnie)
Summary: winnls.h: add GetDateFormatEx() and more
This patch adds GetDateFormatEx() and some other functions and constants to include\winnls.h. Many of these functions first appeared in Windows Vista, and take locale names (LPCWSTR) rather than local identifiers (LCID).
Stack Overflow: http://xrl.us/bnkt8a
Additional sources for NORM_LINGUISTIC_CASING:
MSDN was my main source of information. MSDN gave names for all functions, and types for all their arguments. MSDN also gave names for all constants, but not the values of many constants.
For flags, I tried passing 1 << 0, 1 << 1, 1 << 2, ..., 1 << 31, until I found values that seemed to work. Many functions give errors for invalid flags, thus eliminating many values for flags. After I found possible values, I checked some flags against PInvoke.net or Stack Overflow. I used PInvoke.net to confirm that LOCALE_ALL is zero; MSDN said that zero acts like LOCALE_ALL, but I had feared that LOCALE_ALL had a nonzero value. Meanwhile, FIND_FROMSTART is not zero. FIND_FROMSTART has no effect by itself (as it is already the default), but FIND_FROMSTART | FIND_FROMEND causes an error.
In an earlier post (https://sourceforge.net/mailarchive/message.php?msg_id=29680667), I wrote about how I found the value for NORM_LINGUISTIC_CASING, with help from MSDN and Wikipedia. In L"tr-TR" locale, L"i" and L"I" are not equal when LINGUSITIC_IGNORECASE | NORM_LINGUISTIC_CASING.
MSDN said that LOCALE_NAME_MAX_LENGTH is 85, and LOCALE_INVARIANT is 0x7f. I passed 0x7f to LCIDToLocaleName(), and got L"". I passed L"" to LocaleNameToLCID(), and got 0x7f again. Therefore, LOCALE_NAME_INVARIANT is L"". This matches the value from Stack Overflow.
I am missing the values of three constants. LOCALE_REPLACEMENT must either be 0x8, or any flag from 0x40 to 0x80000000. Stack Overflow claims that LOCALE_NAME_USER_DEFAULT is NULL, and LOCALE_NAME_SYSTEM_DEFAULT is L"!sys-default-locale". While NULL might be correct or wrong, L"!sys-default-locale" seems to be wrong. So, I have no values for these three constants.
2012-08-22 George Koehler <xkernigh@...>
* include/winnls.h [WINVER >= 0x0501] (LOCALE_INVARIANT): Define.
[WINVER >= 0x0600] (LINGUISTIC_IGNORECASE, LINGUISTIC_IGNOREDIALECTIC,
FIND_STARTSWITH, FIND_ENDSWITH, FIND_FROMSTART, FIND_FROMEND,
NORM_LINGUISTIC_CASING, LOCALE_ALL, LOCALE_WINDOWS,
LOCALE_SUPPLEMENTAL, LOCALE_ALTERNATE_SORTS, LOCALE_NAME_INVARIANT,
LOCALE_NAME_MAX_LENGTH, CALINFO_ENUMPROCEXEX, DATEFMT_ENUMPROCEXEX,
LOCALE_ENUMPROCEX, TIMEFMT_ENUMPROCEX, CompareStringEx,
CompareStringOrdinal, EnumCalendarInfoExEx, EnumDateFormatsExEx,
EnumSystemLocalesEx, EnumTimeFormatsEx, FindNLSString, FindNLSStringEx,
GetCalendarInfoEx, GetDateFormatEx, GetTimeFormatEx, LCIDToLocaleName,
[WINVER >= 0x0600] (LOCALE_REPLACEMENT, LOCALE_NAME_SYSTEM_DEFAULT,
LOCALE_NAME_USER_DEFAULT): Document these constants in comments, but
with unknown values.
[WINVER >= 0x0601] (SORT_DIGITSASNUMBERS, LOCALE_NEUTRALDATA,
LOCALE_SPECIFICDATA, LOCALE_ALLOW_NEUTRAL_NAMES, FindStringOrdinal):
Inside the attachment:
add-nls/add-nls.diff: output from cvs diff -u
add-nls/ChangeLog.txt: ChangeLog entry
add-nls/extra/*.c: small test programs
>Comment By: Earnie Boyd (earnie)
Date: 2012-08-22 14:18
Thanks. I'll review and commit eventually but I may need a reroll of the
patch later. It will be several weeks before I get to it. I'm actually
don't some extensive work on the repository now that will detain the patch.
You can respond by visiting: