[Mailman-i18n] Unicode in headers
Dan Ohnesorg
Dan@feld.cvut.cz
Sun, 22 Sep 2002 17:38:50 +0200
Dne Sun, Sep 22, 2002 at 02:52:08PM +0900, Tokio Kikuchi napsal:
> >- are there only ASCII characters =3D OK let it be
> >- are there only characters from locale preferred encoding =3D use loc=
ale
> >encoding
>=20
> I like this idea but how do you define email's preferred language.
> In mailman, it will be mm_cfg.DEFAULT_SERVER_LANGUAGE but ,,,
It is very good solved in mutt, in file sendlib.c, line 800 and above. I
send also comments from the file. In mutt I have a variable, which has li=
st
of encodings in orded of preference:
/*
* Find the best charset conversion of the file from fromcode into one
* of the tocodes. If successful, set *tocode and CONTENT *info and
* return the number of characters converted inexactly. If no
* conversion was possible, return -1.
*
* We convert via UTF-8 in order to avoid the condition -1(EINVAL),
* which would otherwise prevent us from knowing the number of inexact
* conversions. Where the candidate target charset is UTF-8 we avoid
* doing the second conversion because iconv_open("UTF-8", "UTF-8")
* fails with some libraries.
*
* We assume that the output from iconv is never more than 4 times as
* long as the input for any pair of charsets we might be interested
* in.
*/
/*
* Find the first of the fromcodes that gives a valid conversion and
* the best charset conversion of the file into one of the tocodes. If
* successful, set *fromcode and *tocode to dynamically allocated
* strings, set CONTENT *info, and return the number of characters
* converted inexactly. If no conversion was possible, return -1.
*
* Both fromcodes and tocodes may be colon-separated lists of charsets.
* However, if fromcode is zero then fromcodes is assumed to be the
* name of a single charset even if it contains a colon.
*/
cheers
dan
--=20
-----------------------------------------------------------
/ Dan Ohnesorg Dan@ohnesorg.cz \
< Jino=E8ansk=E1 7 252 19 Rudn=E1 u Prahy >
\ tel: +420 311 679679 +420 311 679976 fax: +420 311 679311 /
-----------------------------------------------------------