From 811606059edacfde6d7b383dcbbeb5706bc10b64 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 22 Aug 2011 15:45:16 -0300 Subject: [PATCH] try encoding even if . is not in string --- packages/PLStream/pl-ctype.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/PLStream/pl-ctype.c b/packages/PLStream/pl-ctype.c index f79962914..35367b403 100644 --- a/packages/PLStream/pl-ctype.c +++ b/packages/PLStream/pl-ctype.c @@ -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 )