* nlsfuncs.cc (__set_lc_time_from_win): Use LOCALE_SMONTHNAME1
instead of LOCALE_SABBREVMONTHNAME1 in Japanese and Korean locales to get abbreviated month names. Explain why.
This commit is contained in:
parent
0b3906a813
commit
a36728eae0
@ -1,4 +1,11 @@
|
|||||||
2010-05-18 Kazuhiro Fujida <fujieda@acm.org>
|
2010-05-26 Kazuhiro Fujieda <fujieda@acm.org>
|
||||||
|
Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* nlsfuncs.cc (__set_lc_time_from_win): Use LOCALE_SMONTHNAME1
|
||||||
|
instead of LOCALE_SABBREVMONTHNAME1 in Japanese and Korean
|
||||||
|
locales to get abbreviated month names. Explain why.
|
||||||
|
|
||||||
|
2010-05-18 Kazuhiro Fujieda <fujieda@acm.org>
|
||||||
|
|
||||||
* environ.cc (regopt): Change the first argument to wide char string.
|
* environ.cc (regopt): Change the first argument to wide char string.
|
||||||
(environ_init): Accommodate change to the first argument of regopt.
|
(environ_init): Accommodate change to the first argument of regopt.
|
||||||
|
@ -551,10 +551,20 @@ __set_lc_time_from_win (const char *name,
|
|||||||
sizeof *lc_era, locale_cmp);
|
sizeof *lc_era, locale_cmp);
|
||||||
|
|
||||||
/* mon */
|
/* mon */
|
||||||
|
/* Windows has a bug in Japanese and Korean locales. In these
|
||||||
|
locales, strings returned for LOCALE_SABBREVMONTHNAME* are missing
|
||||||
|
the suffix representing a month. Unfortunately this is not
|
||||||
|
documented in English. A Japanese article describing the problem
|
||||||
|
is http://msdn.microsoft.com/ja-jp/library/cc422084.aspx
|
||||||
|
The workaround is to use LOCALE_SMONTHNAME* in these locales,
|
||||||
|
even for the abbreviated month name. */
|
||||||
|
const LCTYPE mon_base =
|
||||||
|
lcid == MAKELANGID (LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN)
|
||||||
|
|| lcid == MAKELANGID (LANG_KOREAN, SUBLANG_KOREAN)
|
||||||
|
? LOCALE_SMONTHNAME1 : LOCALE_SABBREVMONTHNAME1;
|
||||||
for (int i = 0; i < 12; ++i)
|
for (int i = 0; i < 12; ++i)
|
||||||
{
|
{
|
||||||
_time_locale->wmon[i] = getlocaleinfo (time,
|
_time_locale->wmon[i] = getlocaleinfo (time, mon_base + i);
|
||||||
LOCALE_SABBREVMONTHNAME1 + i);
|
|
||||||
_time_locale->mon[i] = charfromwchar (time, wmon[i]);
|
_time_locale->mon[i] = charfromwchar (time, wmon[i]);
|
||||||
}
|
}
|
||||||
/* month and alt_month */
|
/* month and alt_month */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user