dongwuying0221 2014-04-17 15:34 采纳率: 0%
浏览 30

从VBulletin 3转换为PHPBB3后的MySQL列编码

The following screen shot is going to be good introduction for the issue:

enter image description here

It is from phpmyadmin for the table topics of phpbb3. It shows that at the same table there are two columns one renders text in wrong encoding topic_title and other topic_first_poster_name renders the text correct.

In the convert script I set the $encoding to be windows-1256 as advised because my later VB forum was using windows-1256.

The screen shotted table has utf8_bin collation and topic_title collation is utf8_unicode_ci while topic_first_poster_name is utf8_bin.

What I need is to convert the text of topic_title to be rendered correctly because it make phpbb3 to render it wrong.

I tried the hint in this article about fixing column encoding but I miss able to determine what encoding that I have to use:

UPDATE table SET column=CONVERT(CONVERT(CONVERT(column USING binary) USING utf8) USING cp1251) WHERE id=123;

I have made the following using cp1256 but I did not get any result:

UPDATE t_topics SET topic_title=CONVERT(CONVERT(CONVERT(topic_title USING binary) USING utf8) USING cp1256) WHERE topic_id=2

Update:

When I alter the chaset i.e makin cp1256 first then utf8, the field text becomes like the following and it also wrong: enter image description here

Update 2:

Using the following in the application viewtopic.php solve the problem in the browser's window:

'TOPIC_TITLE'   =>  iconv( "UTF-8","Windows-1256//TRANSLIT", utf8_encode($topic_data['topic_title']))

However, what would this indicate in-order to solve this issue from the database field itself?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么