1 Apr 2008 15:52
Interaction between $LANG and Display Charset (nl_langinfo(CODESET))
There was recently a discussion around using nl_langinfo(CODESET). I do have a similar problem with that routine. Many users on our site do run either pine or the newer alpine in an environment where many mails still in the ISO-8859-1(5) charset are exchanged. Users who have set their LANG variable to something UTF8 like are very pleased with alpine, for those who are working under LANG=C (there are legitimate reasons for them to do so) alpine is less useable than pine. The reason is that nl_langinfo(CODESET) returns ANSI... for LANG=C or for an unset LANG variable and that does force setting of the display charset. While most terminal emulators do not have any problem with umlauts, the value of ANSI... for the display charset prevents its display from within alpine. Looking to the code I have not seen any way to influence that default behaviour by an option in pine.conf. Training the users to change a setting inside alpine is a support nightmare and setting it centrally cannot be done as either the UTF8 fraction or the other part would have by default a garbled umlauts display. My solution was to set the display charset to something sensible if it turned out to start with ANSI... Ideally the unknown charset value could be used for that default setting. My patched alpine just uses a fixed string (ISO-8859-15). It does display nicely umlauts even if the LANG variable does indicate that umlauts would not be known. As the ISO-8859 charsets are supersets of ANSI-... this should not break anything. Is there a chance that such a behaviour gets realized in an upcoming(Continue reading)
RSS Feed