--- pilot-link-0.11.3-back/libpisock/util.c Tue Jul 30 19:37:13 2002 +++ pilot-link-0.11.3/libpisock/util.c Fri Aug 16 10:26:34 2002 @@ -32,7 +32,7 @@ #include #endif -#define PILOT_CHARSET "CP1252" +#define DEFAULT_PILOT_CHARSET "CP1252" /*********************************************************************** * @@ -55,8 +55,14 @@ *ob; iconv_t cd; size_t ibl, obl; + char *charset_env; + + charset_env = getenv("PILOTCHARSET"); + if (charset_env) + cd = iconv_open(charset_env, charset); + if (!charset_env || !cd) + cd = iconv_open(DEFAULT_PILOT_CHARSET, charset); - cd = iconv_open(PILOT_CHARSET, charset); if (!cd) return -1; @@ -98,8 +104,14 @@ *ob; iconv_t cd; size_t ibl, obl; + char *charset_env; + + charset_env = getenv("PILOTCHARSET"); + if (charset_env) + cd = iconv_open(charset_env, charset); + if (!charset_env || !cd) + cd = iconv_open(DEFAULT_PILOT_CHARSET, charset); - cd = iconv_open(charset, PILOT_CHARSET); if (!cd) return -1;