Closed
Description
Description
Backslash(\) and tilde(~) is convert to Shift_JIS (SJIS) using mb_convrert_encoding, But converted word is wrong word. Please see below code and 3v4l https://3v4l.org/nSVPB. Reproduced only PHP 8.1.
The following code:
<?php
var_dump(mb_convert_encoding(mb_convert_encoding("\\", "SJIS", "UTF-8"), "UTF-8", "SJIS"));
var_dump(mb_convert_encoding(mb_convert_encoding("~", "SJIS", "UTF-8"), "UTF-8", "SJIS"));
Resulted in this output:
string(3) "\"
string(3) "〜"
But I expected this output instead:
string(1) "\"
string(1) "~"
PHP Version
PHP 8.1.4
Operating System
No response