昨天发贴说解决了wp中中文乱码的问题,但是马上又发现帖子中的代码:$this->query(”SET NAMES ‘utf8′”);代码中的引号在mysql数据库中存的都没问题,但用wp显示出来就变成全角的了。google后知道这是wp-includes\functions-formatting.php 中的 wptexturize() 函数在搞鬼解决办法:1 使用 sparanoid 的 quotmarks-replacer 解决.(我最后就用这招了)2 把wptexturize中转义的那几行代码注释掉3 见下面wordpress官方论坛中给的2个插件
下面内容来自worpdress官方论坛Quotation Mark/Apostrophe Switch引号 分号 转义
http://wordpress.org/support/topic/32803?replies=3Q:Hello, I use Verdana font for my website and I noticed when I submit a post or page or even a comment it replaces my quotation marks and apostrophes with different ones. The new ones tend to be curved [...]
Archive for November, 2006
wordpress中引号转义的问题
Posted by zeaster in November 30th 2006
成功解决wordpress备份时的中文乱码问题
Posted by zeaster in November 30th 2006
前天心中正美着wordpress可以备份mysql数据,但不幸的是一试才知道中文是乱码,无法备份成功。
现在找到解决办法:
1备份已有数据到sql文件中,所有DEFAULT CHARSET=latin1 改为 DEFAULT CHARSET=utf8。collation选为utf8_unicode_ci。
2修改wp-includes/wp-db.php文件,在$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);后添加$this->query(”SET NAMES ‘utf8′”);
注意事项:
1 使用editplus修改上述文件,UltraEdit不行
2 mysql的版本是4.1.*
3 apahce的版本是2.0.*
4 php的版本是5.2.*
参考文献:
1 kaoart
2 yanfeng
第一个my wordpress,发帖纪念
Posted by zeaster in November 30th 2006
这段日子也写了些blog,但都是放在别人的网站上,如blogger,blog.edu.cn。前一阵发生过blogger,blog.edu.cn服务中断的事儿,想想也后怕,把心得,感悟啥的放到了随时有可能自己访问不到的地方,太没安全感了,哈:)为此,建了这个基于wordpress的blog,这里的文章都放到byethost提供的mysql数据库里了,并且我可以随时对该数据库进行备份。确保不会丢失。另外wordpress也提供了诸多实用的feature :)
Search
Most Comments
- blogsync with gui coming, import your wordpress to blogger (68)
- blogsync 0.3 released, comments can be imported. (18)
- A tool that import all posts from wordpress to blogger in python (8)
- Mac OS X上成功使用dopod 696 wm5.0 连 cmwap上网 (7)
- blogsync 2.0 released, import your wordpress to blogger from rss xml file or online (5)
- How to decompile .dex file on Android (4)
- Inconvenienced when using Contact Content Provider on Android (3)
- 统一Mac OS X,Windows XP/Vista以及linux的系统时间 (2)
- Windows XP/Vista vs Mac OS X 软件对比清单 (2)
- 性能准则之一:在遍历集合前一定要判断集合是否为空 (2)
- A python script that get posts from wordpress by httplib (1)
- blogsync FAQ (1)
Recent Comments
- zeaster in Inconvenienced when using Contact C…
- sshwsfc in Inconvenienced when using Contact C…
- zeaster - How t… in Inconvenienced when using Contact C…
- zeaster - Incon… in How to decompile .dex file on Andro…
- meng_xx in How to decompile .dex file on Andro…
- Elia in blogsync with gui coming, import yo…
- Yichao in blogsync with gui coming, import yo…
- Elia in blogsync with gui coming, import yo…
- Yichao in blogsync with gui coming, import yo…
- Elia in blogsync with gui coming, import yo…