关于txt文件导入数据库编码的问题
现在导入txt文件到数据库,因为编码的原因有些数据写入失败
我在前面加入以下代码后,数据都能导进去,不过全是?????号
mysql_query( “set names ‘GBK'”);
请问怎么把txt文
!本文来源gaodai.ma#com搞##代!^码网(
搞gaodaima代码件内容都转成uft-8的编码
我用以下代码好像不起作用
mb_convert_encoding($u[11], ‘UTF-8′,’ascii,GB2312,gbk,UTF-8’);
——解决方案——————–
$txt = mb_check_encoding($s, ‘utf-8’) ? $txt : mb_convert_encoding($s, ‘utf-8’, ‘gbk’);