Adding upstream version 0.5.2

This commit is contained in:
Tatsuya Kinoshita
2011-05-04 16:23:02 +09:00
parent 72f72d64a4
commit 6db339b3d7
72 changed files with 7191 additions and 4808 deletions

View File

@@ -6,6 +6,10 @@
#include "wc.h"
#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
wc_locale WcLocale = 0;
static struct {
@@ -369,6 +373,13 @@ wc_locale_to_ces(char *locale)
if (*p == 'C' && *(p+1) == '\0')
return WC_CES_US_ASCII;
#ifdef HAVE_LANGINFO_CODESET
{
char *cs = nl_langinfo(CODESET);
if (cs && strcmp(cs, "US-ASCII"))
return wc_charset_to_ces(cs);
}
#endif
for (n = 0; *p && *p != '.' && n < 5; p++) {
if ((unsigned char)*p > 0x20)
buf[n++] = tolower(*p);