Support jOOmla! Autoit!
 
文章里显示星期出现乱码的解决方法 输出PDF 打印 E-mail
Author Author: Autoit | Date Date:2006-10-31 | View Count View: 11141 | Digg Count Digg: 54

在语言文档里涉及到个 "_DATE_FORMAT_LC" 就是获取本地时间格式. 这样的话,如果在 utf-8站点上服务器不支持zh_CN.UTF-8的情况下显示星期通常会出现乱码.解决方法,在输出时间的地方,把编码转一下就好了.

在显示文章地方, 有下面两个. 我用 icovn 来转.

修改: content.html.php

<?php echo $row->created; ?>

 替换为:

<?php echo  iconv("GB2312","UTF-8",$row->created); ?>

在:

$create_date = mosFormatDate( $row->created );

下面加

$create_date = iconv("GB2312","UTF-8",$create_date);

这样乱码就不会出现了,如果服务器不支持 iconv 的话就只能用个 gb-->utf-8的函数了.


Permanent URL: http://www.autoit.cn/index.php/content/view/83/25.html

Shares: Google书签 Yahoo书签 雅虎收藏夹 365Key网摘 新浪ViVi 百度收藏 天极网摘 diglog 和讯网摘 POCO网摘 YouNote网摘 博拉网 天下图摘 spurl blogmarks BlinkList reddit digg Del.icio.us   |  Tags: 星期  乱码  

 
让文章标题处显示的活泼些 [续] Vote's hack   扩充big5_func的Gb互转utf8函数