i have a text "Translate text, webpage, or document "
which i need to translate into Japanese , the google translator
return the string as 翻訳テキスト、 Webページ、またはドキュメント
and when am writing that a text file the (ja.po) it looks like
–|–óƒeƒLƒXƒgA Webƒy[ƒWA‚Ü‚½‚̓hƒLƒ…ƒƒ“ƒg
what would be the error?
i am using poeditor.exe to view the file. am not using any encoding function at present.
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);