Subject: Mailbox International Naming Question ?

From: "Kwangyeon Bae" <[email-masked]>
Date: Sun, 19 Mar 2000 23:23:37 +0900 (KST)

Hello!

We are planning to make IMAP client using C-Client Library.

In RFC2060, Internation Mailbox Naming requests using

modified version of the UTF-7 encoding scheme. But we can't

find related source code to that scheme in C-Client Library.

Where can I find source code or document about that scheme ?

Any comments will be appreciated...

Bae.

-- 
------------------------------------------------------------------
 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: Sun, 19 Mar 2000 12:05:03 -0800 (PST)

> Where can I find source code or document about that scheme ?

The Modified UTF-7 convention is implemented by the application program that
uses the c-client API.  The only thing that c-client does is enforce correct
syntax of Modified UTF-7 names.

Since you seem to be in Korea, here is how you would implement this in your
application program.

To create a mailbox with a Korean name: Accept the mailbox name from the user.
If it is in KSC code, convert it to Unicode.  Then encode the Unicode string
into Modified UTF-7.

To display an existing mailbox name: Decode the Modified UTF-7 name into
Unicode.  If your system only supports KSC code and does not support Unicode,
then convert from Unicode into KSC code.

c-client has a routine that will convert from KSC code in EUC encoding to
Unicode with UTF-8 encoding:
  SIZEDTEXT source,dest;
  source.data = <<unsigned char * pointer to KSC text in EUC encoding>>
  source.size = <<size of KSC text in 8-bit bytes>>
  utf8_text (&source,"EUC-KR",&dest,0);
  <<at this point, Unicode UTF-8 string is in dest.data, with its size in
    dest.size>>

The routine which actually does the work is utf8_text_dbyte().  You may want
to use this routine as a model for writing a routine to generate mailbox names
in Modified UTF-7 instead of UTF-8.

I don't provide any routines to convert from Unicode to KSC.  It's a difficult
problem, since Unicode has many characters that aren't in KSC.  For example,
suppose you get a Korean text that uses a hanja from China or Japan, but is
not used in Korean.  How do you display it?

It is much easier if your application is written to use Unicode internally, so
you only worry about generating KSC text in outgoing mail.  For reading mail,
just convert everything to Unicode.  You can do this easily under Windows; it
is harder to do this with UNIX.