Menu

CJK encoding

Help
jb keum
2002-07-18
2002-07-18
  • jb keum

    jb keum - 2002-07-18

    Jawmail 2.0rc
    How can I set subject to be displayed as Chineses, Japanese, or Korean?  They are all broken up.

    I am looking at this line
    ------>        $this->msg->setHeader('Subject', mime::decode($h->subject));
                    $this->msg->setHeader('From',   $this->mime_decode_addr($h->from, true),        $this->mime_decode_addr($h->from));
                    $this->msg->setHeader('To',     $this->mime_decode_addr($h->to, true),          $this->mime_decode_addr($h->to));
                    $this->msg->setHeader('Cc',     $this->mime_decode_addr($h->cc, true),          $this->mime_decode_addr($h->cc));
                    $this->msg->setHeader('Bcc',    $this->mime_decode_addr($h->bcc, true),         $this->mime_decode_addr($h->bcc));
                    $this->msg->setHeader('Reply-To', $this->mime_decode_addr($h->reply_to, true),  $this->mime_decode_addr($h->reply_to));

    in apps/mail/lib/mime/imap_parser.php, but I have no clue how to fix that.

    any help will be greatly appreciated.

     
    • jb keum

      jb keum - 2002-07-18

      I am also looking at lib/mime.php for the function decode.

              function decode($string) {

                      $ar = imap_mime_header_decode($string);
                      //print_r($ar);
                      if (is_array($ar)) {
                              $string = "";
                              foreach ($ar as $v) {
                                      $string .= r_($v->text, $v->charset);
                              }
                      }

                      return $string;
              }
      When I uncommnented the print_r ($ar), I was able to see the subject heading correctly for Chinese, Japanese, and Korean.  However, what does r_($v->text, $v->charset) do?  The reason is, I just went ahead and fix the line to $string .= $v->text (forigive my stupidity).  I was able to view the subject correctly, yet I wasn't able to view the message content.  Clicking at the subject link ended up with blank screen. 

      Please someone help.

       
      • Rudi Benkovic

        Rudi Benkovic - 2002-07-18

        r_() is defined in lib/lang.php. It recodes the string from the original charset ($v->charset) into the target output charset (by default, UTF-8). So, if the subject or any other header/body wasn't properly marked with a proper charset ... Sorry, can't help.

        You can bounce the troublesome message to me, I'll take a look.

         

Log in to post a comment.