diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | missing/langinfo.c | 7 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Tue Feb 3 07:02:11 2009 Nobuyoshi Nakada <[email protected]> + + * missing/langinfo.c (nl_langinfo_codeset): accepts iso-8859 + fragment. [ruby-core:21757] + Tue Feb 3 07:01:21 2009 Nobuyoshi Nakada <[email protected]> * mkconfig.rb (patchlevel): config.status may not contain diff --git a/missing/langinfo.c b/missing/langinfo.c index a76000bc77..6373afd0f5 100644 --- a/missing/langinfo.c +++ b/missing/langinfo.c @@ -63,6 +63,7 @@ const char * nl_langinfo_codeset(void) { const char *l, *p; + int n; if (((l = getenv("LC_ALL")) && *l) || ((l = getenv("LC_CTYPE")) && *l) || @@ -75,9 +76,9 @@ nl_langinfo_codeset(void) if (!p++) p = l; if (strstart(p, "UTF")) return "UTF-8"; - if (strstart(p, "8859-")) { - if (digit(p[5])) { - p += 5; + if ((n = 5, strstart(p, "8859-")) || (n = 9, strstart(p, "ISO-8859-"))) { + if (digit(p[n])) { + p += n; memcpy(buf, "ISO-8859-\0\0", 12); buf[9] = *p++; if (digit(*p)) buf[10] = *p++; |