From: Matthias Andree Date: Sun, 7 Nov 2004 23:50:34 +0000 (-0000) Subject: Provide iana_charset, a normalized IANA charmap name. X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=b88a50bdd3b4223be5a235f20f275ca87c62a7bb;p=~andy%2Ffetchmail Provide iana_charset, a normalized IANA charmap name. svn path=/trunk/; revision=3980 --- diff --git a/Makefile.am b/Makefile.am index cc8cbd15..bbd82289 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,7 @@ fetchmail_SOURCES= fetchmail.h getopt.h \ opie.c rpa.c interface.c netrc.c \ unmime.c conf.c checkalias.c smbdes.c smbencrypt.c \ smbmd4.c smbutil.c ipv6-connect.c lock.c \ - rcfile_l.l rcfile_y.y + rcfile_l.l rcfile_y.y ucs/norm_charmap.c check_PROGRAMS= rfc822 unmime netrc rfc2047e @@ -64,7 +64,7 @@ DISTDOCS= FAQ FEATURES NOTES fetchmail-man.html fetchmail-FAQ.html \ # extra directories to ship distdirs = rh-config contrib beos -EXTRA_DIST= $(DISTDOCS) fetchmail.spec $(distdirs) +EXTRA_DIST= $(DISTDOCS) fetchmail.spec $(distdirs) ucs/README.svn FAQ: fetchmail-FAQ.html AWK=$(AWK) $(SHELL) $(srcdir)/html2txt.sh $(srcdir)/fetchmail-FAQ.html >$@ || { rm -f $@ ; exit 1 ; } diff --git a/fetchmail.c b/fetchmail.c index 1756c73f..07ca6eb8 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -30,6 +30,10 @@ #endif /* HAVE_SETRLIMIT */ #include +#ifdef HAVE_LANGINFO_H +#include +#endif + #include "fetchmail.h" #include "socket.h" #include "tunable.h" @@ -120,6 +124,8 @@ static RETSIGTYPE donothing(int sig) lastsig = sig; } +char *iana_charset; + int main(int argc, char **argv) { int bkgd = FALSE; @@ -139,6 +145,11 @@ int main(int argc, char **argv) setlocale (LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); + iana_charset = norm_charmap(nl_langinfo(CODESET)); /* normalize local + charset to + IANA charset. */ +#else + iana_charset = "US-ASCII"; #endif /* diff --git a/fetchmail.h b/fetchmail.h index a4d56622..8b14e918 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -420,6 +420,11 @@ extern char *sdps_envfrom; extern char *sdps_envto; #endif /* SDPS_ENABLE */ +extern char *iana_charset; /* IANA assigned charset name */ + +/* from ucs/norm_charmap.c */ +const char *norm_charmap(const char *name); + /* prototypes for globally callable functions */ /* from /usr/include/sys/cdefs.h */