Subject: how come this doesn't work?

From: Mike Trank <[email-masked]>
Date: Fri, 11 Aug 2000 20:19:30 -0600 (CST)

/*B

sendmail usually does all the conversion of this stuff when the mail gets
delivered locally, but the headers are still with this iso-8859
codification stuff.

so I want to use the rfc822_qprint thing to convert them to 8bit chars

isn't that what rfc822_qprint is for?

the printf below gives me "null" and the newlen is 0.....

I want it to print out Andy Rodriguez, but the "i" is with the accent on
it.

sorry, i dont know how to get that on my keyboard.

Thanks for the help...

*/

#include <stdio.h>
#include <string.h>
#include <mail.h>
#include <rfc822.h>

#include "callback.c"

int count;

int main() {

        char *mystr = "Andy =?iso-8859-1?Q?Rodr=EDguez?=";
        char outstr[200];
        unsigned long newlen; 

        bzero(outstr, 200);
        printf("%s\n", rfc822_qprint(mystr, strlen(mystr), &newlen));
        printf("%d\n", newlen);
        exit(0);

        }

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Fri, 11 Aug 2000 19:30:16 -0700 (PDT)

rfc822_qprint() converts quoted printable data to 8-bit.

The token that you are trying to convert is a MIME2 quoted-word.  Part of it
is in a format similar, but not identical, to quoted-printable format.

The only routine in c-client that deals with MIME2 quoted-words is the routine
utf8_mime2text(), which will convert text containing MIME2 quoted-words into
the equivalent UTF-8 (Unicode) text.

If you're stuck with a UNIX system that can only display ISO-8859-1, either
you must parse the quoted-word yourself using utf8_mime2text() as a model, or
you should try convert the UTF-8 text into ISO-8859-1.  Note that quoted words
which use other character sets, even something as closely related as
ISO-8859-2, will probably not convert to ISO-8859-1 in any reasonable way.
There is, unfortunately, not much better that you can do that this; Unix has
fallen sadly behind the times when it comes to internationalization.

If you are implementing for Windows, then you should use the Windows Unicode
display routines and not the obsolete routines for ISO-8859-1.  Modern
versions of Windows support Unicode, and all new Windows programs should use
Unicode instead of the old code page kludges.