About transcoding Issues
Import 503-9256962-4382268 Failure-1
You have a error in your SQL syntax; Check the manual that corresponds to your MySQL server version for the right syntax to use near ' 054-246-0787 ', ' JPS0001 ', ' 0243-BK ', ' iphone 4 with arm strap (black) ', ' 1 ', ' Buzzard?? ' at line 1
I have done transcoding also reported above error, my transcoding function:
$recipient _name=mb_convert_encoding (Addslashes ($u [+]), ' UTF-8 ', ' Utf-8,sjis-win,eucjp-win ');
Echo Base64_encode ($u [16]) Result: MGIRG4XC
I output transcoding after the result is right: "Buzzard Nest GUI", but do not know to write to the database will be error, I found that only contains "GUI" will be written to the database failed.
Is there any way to solve this problem??
Share to:
------Solution--------------------
$s = base64_decode (' mgirg4xc ');
Echo ' character set ', mb_detect_encoding ($s, ' utf-8,sjis-win,eucjp-win '), '
';
Echo ' 16 inside code ', Bin2Hex ($s), '
';
Echo ' Utf-8 ', $t = mb_convert_encoding ($s, ' utf-8 ', ' Utf-8,sjis-win,eucjp-win '), '
';
Echo ' 16 binary inside code ', Bin2Hex ($t);
Character Set Jis-win
16 in-code 986891838c 5cThis 5c is \ 's 16 binary inside code
Utf-8 Buzzard Nest GUI
16 Binary inside Code E9B7B2E5B7A3E59CAD
So you need
$recipient _name=mb_convert_encoding ($u [+], ' UTF-8 ', ' Utf-8,sjis-win,eucjp-win ');
Instead of
$recipient _name=mb_convert_encoding (Addslashes ($u [+]), ' UTF-8 ', ' Utf-8,sjis-win,eucjp-win ');
That can't be escaped with addslashes.
Escape ' requires Str_replace ("'", "\ '", $s)