开发者

Translating non-latin characters from a latin only system

开发者 https://www.devze.com 2023-03-28 21:40 出处:网络
Apologies if this has already been answered previously... We\'ve got an online mail reader (php based) that currently substitutes \"�\" or the upright rectangle for non-latin based characters in a w

Apologies if this has already been answered previously...

We've got an online mail reader (php based) that currently substitutes "�" or the upright rectangle for non-latin based characters in a window where the message body is loaded via an iframe. The texts are generally stored base64 encoded, so my question is, are there online translation tools that I can send the base64 encoded string that will decode the string, translate it, and return the translation (either base64 or decode开发者_运维技巧d makes no difference)?


base64_encode(mb_convert_encoding(base64_decode($string), 'charset1', 'charset2'));

you'd have to fill in appropriate values for the two character sets. however, you should be storing/processing/ouputting everything using UTF-8, as it makes so many of these kinds of problems simply vanish.

0

精彩评论

暂无评论...
验证码 换一张
取 消