关于转码问题
import 503-9256962-4382268 Failure -1
You have an 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 用臂帶 (黑色)', '1', '鷲??' at line 1
我进行了转码也报以上错误,我的转码函数:
$recipient_name=mb_convert_encoding(addslashes($u[16]), 'UTF-8','UTF-8,sjis-win,eucjp-win');
echo base64_encode($u[16])结果:mGiRg4xc
我输出转码后的结果是对的:"鷲巣圭",但是不知道写入数据库就会报错,我发现只有包含"圭"的都会写入数据库失败。
请问有什么办法解决这个问题??
[解决办法]
$s = base64_decode('mGiRg4xc');
echo '字符集 ', mb_detect_encoding($s, 'UTF-8,sjis-win,eucjp-win'), '<br>';
echo '16进制内码 ', bin2hex($s), '<br>';
echo 'utf-8 ', $t = mb_convert_encoding($s, 'utf-8', 'UTF-8,sjis-win,eucjp-win'), '<br>';
echo '16进制内码 ', bin2hex($t);