jonathanbee Posted October 3, 2007 Share Posted October 3, 2007 I can get $comments out of the db and put it on screen fine, but when I try to email it, there is an encoding problem. So this code: $body .= "コメント<br/>" . $comments; correctly generates this text in the email: コメント 30%アップの料金で宜しくお願い致します。 But if I take $comments from the db instead, it will not appear correctly. I am using charset=EUC-JP". Somehow I have to get $comments converted to unicode after I query the db.. Thanks for any suggestions. Link to comment https://forums.phpfreaks.com/topic/71611-solved-please-help-me-convert-my-variable-to-unicode/ Share on other sites More sharing options...
jonathanbee Posted October 3, 2007 Author Share Posted October 3, 2007 i have tried: $c= mb_convert_encoding($comments, "UTF-8"); but, still it won't work... Link to comment https://forums.phpfreaks.com/topic/71611-solved-please-help-me-convert-my-variable-to-unicode/#findComment-360567 Share on other sites More sharing options...
jonathanbee Posted October 3, 2007 Author Share Posted October 3, 2007 i think i need to convert the data to HTML Entity Codes not utf 8... i don't think htmlentities is quite what i need, is there anything else out these that might work? Link to comment https://forums.phpfreaks.com/topic/71611-solved-please-help-me-convert-my-variable-to-unicode/#findComment-360596 Share on other sites More sharing options...
jonathanbee Posted October 3, 2007 Author Share Posted October 3, 2007 can't believe shift jis worked, but this fixed it.. $c = iconv("EUC-JP", "SJIS", $comments); Link to comment https://forums.phpfreaks.com/topic/71611-solved-please-help-me-convert-my-variable-to-unicode/#findComment-360626 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.