Home > Backend Development > PHP Tutorial > 关于转编码的问题

关于转编码的问题

WBOY
Release: 2016-06-23 14:19:51
Original
889 people have browsed it

我们每天从网站上下载一具txt文件,里面有法文,日文,德文,我现在是用以下转码

$ship_address3=mb_convert_encoding(addslashes($u[19]), 'UTF-8','UTF-8, eucjp-win, sjis-win, ISO-8859-15,ISO-8859-1');

日文转码没问题,但法文和德文转码有问题,请问有什么办法对法文,德文进行转码?


回复讨论(解决方案)

要先知道待??的原文是啥??,然後才??的?行??

//注意???序
$encode=mb_detect_encoding($keytitle,array('ASCII','GB2312','GBK','UTF-8'),true);
IF(StrToLower(Mb_detect_encoding($encode))!='utf-8') {
//将任意进制的内容转为UTF-8格式
$keytitle=Mb_convert_encoding($keytitle,'UTF-8','ASCII,GBK,JIS,EUC-JP,SJIS,UCS-2LE,JIS,eucjp-win,sjis-win');
}

我用mb_detect_encoding查的结果是UTF-8, sjis-win, ISO-8859-15三个都有,但是就是转不过来。日本的文件显示的就只有sjis-win,可以转换过来

我用mb_detect_encoding查的结果是UTF-8, sjis-win, ISO-8859-15三个都有,但是就是转不过来。日本的文件显示的就只有sjis-win,可以转换过来
如果是在同一篇文章?有三?不同的??,那你得想?法先分段,分段之後??不同的???行不同的??

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template