Dunhill Dimaapi
Dunhill Dimaapi

Reputation: 63

Convert from UTF-8 to Shift-JIS

The current email is in UTF-8. It's not working on Shift-JIS.
How can I convert from UTF-8 to SHIFT-JIS. The solution needs to be a PHP solution.

This is what I have tried so far

$subject = mb_convert_encoding ($subject, "JIS", "SJIS");

$subject = base64_encode ($subject);

$subject = "=?iso-2022-jp?B?" . $subject . "?=";    

Upvotes: 4

Views: 9311

Answers (1)

Oliver Nybroe
Oliver Nybroe

Reputation: 1866

You can convert utf-8 to shift-JIS by doing this:

$str = mb_convert_encoding($str, "SJIS", "UTF-8");

Upvotes: 6

Related Questions