Revision 333 src/codeconv.c
| codeconv.c (revision 333) | ||
|---|---|---|
| 890 | 890 |
{
|
| 891 | 891 |
if (encoding && (encoding[0] == 'X' || encoding[0] == 'x') && |
| 892 | 892 |
encoding[1] == '-') {
|
| 893 |
if (!g_strcasecmp(encoding, CS_X_GBK)) |
|
| 893 |
if (!g_ascii_strcasecmp(encoding, CS_X_GBK))
|
|
| 894 | 894 |
return CS_GBK; |
| 895 | 895 |
} |
| 896 | 896 |
|
| ... | ... | |
| 1472 | 1472 |
|
| 1473 | 1473 |
/* "ja_JP.EUC" matches with "ja_JP.eucJP", "ja_JP.EUC" and |
| 1474 | 1474 |
"ja_JP". "ja_JP" matches with "ja_JP.xxxx" and "ja" */ |
| 1475 |
if (!strncasecmp(cur_locale, locale_table[i].locale, |
|
| 1476 |
strlen(locale_table[i].locale))) {
|
|
| 1475 |
if (!g_ascii_strncasecmp(cur_locale, locale_table[i].locale,
|
|
| 1476 |
strlen(locale_table[i].locale))) {
|
|
| 1477 | 1477 |
cur_charset = locale_table[i].charset; |
| 1478 | 1478 |
return cur_charset; |
| 1479 | 1479 |
} else if ((p = strchr(locale_table[i].locale, '_')) && |
| 1480 | 1480 |
!strchr(p + 1, '.')) {
|
| 1481 | 1481 |
if (strlen(cur_locale) == 2 && |
| 1482 |
!strncasecmp(cur_locale, locale_table[i].locale, 2)) {
|
|
| 1482 |
!g_ascii_strncasecmp(cur_locale, |
|
| 1483 |
locale_table[i].locale, 2)) {
|
|
| 1483 | 1484 |
cur_charset = locale_table[i].charset; |
| 1484 | 1485 |
return cur_charset; |
| 1485 | 1486 |
} |
| ... | ... | |
| 1534 | 1535 |
for (i = 0; i < sizeof(locale_table) / sizeof(locale_table[0]); i++) {
|
| 1535 | 1536 |
const gchar *p; |
| 1536 | 1537 |
|
| 1537 |
if (!strncasecmp(cur_locale, locale_table[i].locale, |
|
| 1538 |
strlen(locale_table[i].locale))) {
|
|
| 1538 |
if (!g_ascii_strncasecmp(cur_locale, locale_table[i].locale,
|
|
| 1539 |
strlen(locale_table[i].locale))) {
|
|
| 1539 | 1540 |
out_charset = locale_table[i].out_charset; |
| 1540 | 1541 |
break; |
| 1541 | 1542 |
} else if ((p = strchr(locale_table[i].locale, '_')) && |
| 1542 | 1543 |
!strchr(p + 1, '.')) {
|
| 1543 | 1544 |
if (strlen(cur_locale) == 2 && |
| 1544 |
!strncasecmp(cur_locale, locale_table[i].locale, 2)) {
|
|
| 1545 |
!g_ascii_strncasecmp(cur_locale, |
|
| 1546 |
locale_table[i].locale, 2)) {
|
|
| 1545 | 1547 |
out_charset = locale_table[i].out_charset; |
| 1546 | 1548 |
break; |
| 1547 | 1549 |
} |
| ... | ... | |
| 1615 | 1617 |
is_ja_locale = 0; |
| 1616 | 1618 |
cur_locale = conv_get_current_locale(); |
| 1617 | 1619 |
if (cur_locale) {
|
| 1618 |
if (g_strncasecmp(cur_locale, "ja", 2) == 0) |
|
| 1620 |
if (g_ascii_strncasecmp(cur_locale, "ja", 2) == 0)
|
|
| 1619 | 1621 |
is_ja_locale = 1; |
| 1620 | 1622 |
} |
| 1621 | 1623 |
|
Also available in: Unified diff