try encoding even if . is not in string

This commit is contained in:
Vitor Santos Costa 2011-08-22 15:45:16 -03:00
parent fc9c92b5c1
commit 811606059e

View File

@ -841,9 +841,14 @@ initEncoding(void)
} else if ( (enc = setlocale(LC_CTYPE, NULL)) )
{ LD->encoding = ENC_ANSI; /* text encoding */
if ( (enc = strchr(enc, '.')) )
/* this does not work on the mac for some reason */
if (strchr(enc, '.')) {
enc = strchr(enc, '.');
/* skip '.' */
enc++;
}
if ( enc )
{ const enc_map *m;
enc++; /* skip '.' */
for ( m=map; m->name; m++ )
{ if ( strcmp(enc, m->name) == 0 )