To do conversion from one non-UTF-8 character set into another non-UTF-8 character set, you can use the new utf8_cstocstext() routine (I forget if this made it into imap-2004, but it's in imap-2004a). You can do things faster and with less memory if you set up the conversion tables yourself using utf8_rmap() -- Pine does this; look at the routines in strings.c and filter.c in the Pine sources.
Basically convert ISO-8859-1, UTF-8, ISO-8859-15, etc characters to whatever I need in order to display the characters.
Unless you are writing a text-based client for UNIX, you should convert everything into UTF-8 and use exclusively Unicode for display. Even if you are writing a text-based client for UNIX, you should still consider using Unicode (UTF-8 is just a means of representing Unicode) as newer versions of UNIX now support UTF-8.
The only purpose for any other character set is to accept data in the other character set in incoming mail and files (and possibly from the user's keyboard -- although Unicode is preferred here too), and if necessary to sent mail in a non-Unicode character set (although this is doomed to deprecation).
Put another way, most programs should only need utf8_text() and utf8_cstext().
Or, if you feel that you need to be able to convert ISO-8859-15 to KOI8-R or ISO-2022-JP or BIG5, you are probably doing something wrong.
-- Mark --
http://staff.washington.edu/mrc Science does not emerge from voting, party politics, or public debate. Si vis pacem, para bellum.
