2

I have a text file. It contains "砡" character and its encoding is Shift-JIS.

I using function file_get_contents() in PHP (Laravel) to read this file, then response in json for client.

$file = file_get_contents("/path/to/file/text");
$file = iconv("SJIS", "UTF-8//IGNORE", $file);
return response()->json(['content' => $file]);

However, this charater "砡" doesn't correctly display, it show to "x".

How do I fix it ?

Quy Nguyen Vu
  • 181
  • 2
  • 13

1 Answers1

3

Try "SJIS-win" instead of "SJIS".

Will
  • 53
  • 6