Hastymail2

Hastymail2 is an Open Source IMAP webmail client written in PHP. Our focus is compliance, usability, security, and speed.

Hastymail 2


Character Encoding (Non UTF-8)

When email is received in Hastymail with for instance ISO-2022-JP/8-Bits character encoding, very often used in Japan, Hastymail will convert it default into UTF-8 to display.

I have digged through all PHP scripts of Hastymail and everything is fixed UTF-8.

When replying on differently encoded emails it stays encoded in UTF-8.

It is very well possible that receiver cannot see such email i.e. it is good practise to reply emails in the same character encoding. This is not possible now with Hastymail. There is no option to set the character-encoding except for 8-bits, Base64 and Quoted-Printable.

Other open source webmailers like Horde follow senders encoding correctly.

I think Hastymail would be much better when non-fixed character encoding would be implemented.

The PHP Manual on multi-byte encoding is here also quite clear in:

http://jp.php.net/manual/en/mbstring.ja-basic.php

Hastymail uses mb_convert_encoding of the PHP  Multibyte String Functions to convert other encodings into UTF-8.

Since Hastymail already depends on PHP4 and if other (Db)features are needed by users even on PHP5 maybe a good idea to use more mb_ functions like in this example?

  1. assume Encoding is derived like this $enc = mb_detect_encoding($received_text)
  2. mb_language("japanese");
  3. mb_internal_encoding("EUC-JP");
  4.  
  5. //日本語メール送信
  6. $to = "katou@example.com";
  7. $subject = "例の件について";
  8. $body = "どうでしょう?";
  9. $from = mb_encode_mimeheader(mb_convert_encoding("山本 正喜","JIS","EUC-JP"))."<masaki@example.com>";
  10.  
  11. //ちゃんと日本語メールが送信できます
  12. mb_send_mail($to,$subject,$body,"From:".$from);

Further no comment -  I like this light-weight HastyMail very much after a few days playing with it!

Cheers!

Fred


Name
Subject
Reply
Security Image:
security image
Enter the letters you see above.
 
Get Hastymail at SourceForge.net. Fast, secure and Free Open Source software downloads