我有一些文字需要翻译成日语。
Translate text, webpage, or document
Google 翻译将字符串返回为:
翻訳テキスト、 Webページ、またはドキュメント
当我将该文本写入文件(ja.po)时,它看起来像:
–|–óƒeƒLƒXƒgA Webƒy[ƒWA‚Ü‚½‚̓hƒLƒ…ƒƒ“ƒg
会是什么错误?
我正在使用poeditor.exe查看文件。我目前没有使用任何编码功能。
for(/*extracting from the trnslated string array*/)
{
$pattern = "/msgid \"".preg_quote($id, '/')."\"(\r?\n)msgstr \"\"/";
$string = str_replace('"', '\"', $string);
$replacement = "msgid \"$id\"\nmsgstr \"". $string . "\"";
$res = preg_replace($pattern, $replacement, $con);
$con = $res;
}
file_put_contents("ja.po", $con);