The following screen shot is going to be good introduction for the issue:
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:
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?