improvements to language support.

This commit is contained in:
Vitor Santos Costa
2010-05-05 12:45:11 +01:00
parent 950144a63f
commit f3b6a044f6
3 changed files with 61 additions and 49 deletions

View File

@@ -186,11 +186,13 @@ DefaultEncoding(void)
char *s = getenv("LANG");
size_t sz;
/* if we don't have a LNAG then just use ISO_LATIN1 */
/* if we don't have a LANG then just use ISO_LATIN1 */
if (s == NULL)
s = getenv("LC_CTYPE");
if (s == NULL)
return ENC_ISO_LATIN1;
sz = strlen(s);
if (sz > 5) {
if (sz >= 5) {
if (s[sz-5] == 'U' &&
s[sz-4] == 'T' &&
s[sz-3] == 'F' &&