U+2212 (Minus Sign) and Java's ISO-2022-JP conversion

From: Katsuhiko Momoi (momoi@alumni.indiana.edu)
Date: Fri Apr 01 2005 - 02:24:18 CST

  • Next message: Michael Everson: "Re: Tamil 0B83: Tamil Aytham and Devanagari VisargaL"

    Hi,

    There is a curious problem concerning Java's encoding conversion. I
    would like to convert \u2212 (Minus Sign) to ISO-2022-JP equivalent on
    Linux. (On Windows this character maps to Shift_JIS 0x817C.)

    Using Java's native2ascii conversion utility -- I used the one that came
    with SDK 1.5 for Windows, \u2212 converts to ISO-2022-JP. But when
    ISO-2022-JP is specified in creating mail body, e.g.

                 MimeBodyPart textbodypart = new MimeBodyPart();
                 String type = "text/plain; charset=" + body_encoding;
                 textbodypart.setContent(body, type);

    for body_encoding, Java fails to convert \u2212 to ISO-2022-JP. (JDK
    version 1.4.x.)
    This is on Linux. Since ISO-2022-JP is not a platform specific encoding,
    I gather it should be the same on Windows or Linux.

    Has anyone experienced this problem? I would appreciate a workaround or
    a solution.

    Thanks,

    - Kat

    -- 
    Katsuhiko Momoi
    e-mail: katmomoi@pacbell.net
    


    This archive was generated by hypermail 2.1.5 : Fri Apr 01 2005 - 02:26:43 CST