这是一段实现乱码自动转换为中文的自定义类changcode
class changecode{
private $str;
private $input;
private $output;
function __construct($input="",$output='gb2312'){
$this->input = $input;
$this->output = $output;
}
protected function chgcode($str){
if($this->input != ''){
$this->str = iconv($input,$output,$str);
}else{
$this->str = mb_convert_encoding($str,$output);
}
}
function getStr($str){
$this->chgcode($str);
return $this->str;
}
function setInput($input){
$this->input = $input;
}
function setOutput($output){
$this->output = $output;
}
function getInput(){
return $this->input;
}
function getOutput(){
return $this->output;
}
}
?>
我的问题是怎么调用这段代码实现转换为中文貌似不管用
$str="??";//这是繁体字
$test=new changecode();
echo $test -> getStr($str);
我想知道为什么还是输出繁体字
追梦A系列(11.0版本,以下11.0均简称为A)是针对企业网站定制设计的,模板采用全新AS3.0代码编辑,拥有更快的运行和加载速度,A系列模板主要针对图片展示,拥有简洁大气展示效果,并且可以自由扩展图片分类,同时还拥有三个独立页面介绍栏目,一个新闻栏目,一个服务介绍栏目,一个幻灯片展示和flv视频播放栏目。A系列模板对一些加载效果进行了修改,包括背景的拉伸模式以及标题的展示方式等都进行了调整,同
0
是不是因为setInput也要指定BIG5呢?
好像也不管用啊,求助,在线等
你这个程序只是转编码,与简繁没有关系。
简繁转换是需要有对照表的。
贴出的程序转码而已,繁体转简体参照
http://download.csdn.net/detail/very68com/5895009
你需要有个简繁对应表,例如gb2big.map
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号