On Thu, 24 Jun 2004 11:42:26 -0700 (PDT), Mark Crispin <[EMAIL PROTECTED]> wrote:

On Thu, 24 Jun 2004, Shawn Walker wrote:
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.


The program isn't running on unix. It's running on Windows with Outlook (I know, bear with me. ;)


I have a string "I�t�rn�ti�n�liz�ti�n" that I need to encode before putting it in the body contents of BODY. I don't have utf8_cstocstext(), but would that function do what I need to do? I tried utf8_cstext() but, it didn't do anything (I passed UTF-8 for the charset).

Thanks,
Shawn

Reply via email to