Re: Trouble with umlauts in ISO locale

Frank Terbeck <[email protected]>
Newsgroups gmane.network.slrn.user
Message-ID <[email protected]>
Thomas Wiegner <[email protected]>:
> * Frank Terbeck ([email protected]) wrote [080107 13:28]:
> 
> > I'm building the current SVN version of slrn with the following
> > options:
> 
> > [snip]
> > ./configure --enable-strict-from --enable-mid-cache --enable-spool  \
> >             --enable-charmap     --with-ssl         --enable-decode
> > [snap]
> 
> > Which results in:
> 
> > [snip]
> > % /usr/local/bin/slrn --version
> > slrn pre0.9.9-77
> >         * Note: This version is a developer preview.
> > S-Lang Library Version: 2.1.3
> > Compiled at: Jan  7 2008 13:12:59
> > Operating System: Linux
> 
> > With this setup, every umlaut is displayed as '?'.
> > If I'm starting slrn like this: 'LC_CTYPE=de_DE.UTF-8 slrn' and use
> > an utf8-aware terminal like urxvt, the characters are displayed
> > correctly.
> 
> confirmed here, it is a bug. Normally slrn should detect the locale
> via the nl_langinfo() function.  
> 
> #v+
> #if defined(HAVE_LOCALE_H) && defined(HAVE_LANGINFO_H)
>   if (Slrn_Display_Charset == NULL)
>     {
>        setlocale(LC_ALL, "");
>        Slrn_Display_Charset = slrn_safe_strmalloc (nl_langinfo (CODESET));
>     }
> #endif
> #v-
> 
> But with slrn 0.9.9 I can't find the HAVE_LANGINFO_H anywhere in the
> config.h, it seems it got lost somehow in the configure script.
> 
> You could try to add 
> 
> #define HAVE_LANGINFO_H 1
> 
> to your config.h file after the configure run. 

Yeah, that seems to be the case.
I'm not sure if this is clean enough, but it works for me:

Index: configure
===================================================================
--- configure	(revision 259)
+++ configure	(working copy)
@@ -8435,6 +8435,7 @@
 
 
 
+
 for ac_header in \
 stdlib.h \
 unistd.h \
@@ -8449,6 +8450,7 @@
 arpa/inet.h \
 sys/utsname.h \
 locale.h \
+langinfo.h \
 
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
Index: src/config.hin
===================================================================
--- src/config.hin	(revision 259)
+++ src/config.hin	(working copy)
@@ -78,6 +78,8 @@
 
 #undef HAVE_LOCALE_H
 
+#undef HAVE_LANGINFO_H
+
 /* define if you have a "timezone" variable in time.h */
 #undef HAVE_TIMEZONE
 
Index: autoconf/configure.ac
===================================================================
--- autoconf/configure.ac	(revision 259)
+++ autoconf/configure.ac	(working copy)
@@ -238,6 +238,7 @@
 arpa/inet.h \
 sys/utsname.h \
 locale.h \
+langinfo.h \
 )
 
 #AC_CHECK_LIB(socket, socket, [LIBSOCKET="-lnsl -lsocket"]) dnl for Solaris


> Or you could try to force slrn to use iso-8859-15 by adding
> 
> charset Display  iso-8859-15

Is this new? I wasn't aware character sets were set up like that...
I haven't found this in the manual.

Both of your suggestions solved my problem, thanks a lot!

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.