From 8872d67362085d04abf64631a43dbc8303a45482 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Sun, 27 Mar 2011 17:31:03 +0900 Subject: [PATCH 2/2] If codeset is not set by the user, use a codepage for a codeset on OS/2 --- libcharset/lib/localcharset.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libcharset/lib/localcharset.c b/libcharset/lib/localcharset.c index 3aceb42..15382eb 100644 --- a/libcharset/lib/localcharset.c +++ b/libcharset/lib/localcharset.c @@ -475,6 +475,7 @@ locale_charset (void) ULONG cp[3]; ULONG cplen; + codeset = NULL; /* Allow user to override the codeset, as set in the operating system, with standard language environment variables. */ locale = getenv ("LC_ALL"); @@ -504,12 +505,13 @@ locale_charset (void) buf [modifier - dot] = '\0'; return buf; } - } - /* Resolve through the charset.alias file. */ - codeset = locale; + /* Resolve through the charset.alias file. */ + codeset = locale; + } } - else + + if (codeset == NULL) { /* OS/2 has a function returning the locale's codepage as a number. */ if (DosQueryCp (sizeof (cp), cp, &cplen)) -- 1.7.3.2