Utf Code Problem: Help Converting “ - †- … - – - ‘ - ’ to Normal

Started by mggevo, October 04, 2015, 07:11:04 PM

Previous topic - Next topic

mggevo

Greetings,
I recently migrated my forum and having trouble with utf coding in some of my forum topics.

Not sure if disabling the TinyMCE on EzPortal or making an error in the process of site migration caused some of the forum topics (smf_topics) and messages (smf_messages) in my database converted below characters

" to “ and ”

... to …

- to â€"

' to ‘ and ’

Now, I made some search and found this topic http://www.simplemachines.org/community/index.php?topic=327519.0 and the code shared there:

update smf_messages
set body = replace(body,'’','\'');

update smf_messages
set body = replace(body,'…','...');

update smf_messages
set body = replace(body,'â€"','-');

update smf_messages
set body = replace(body,'“','"');

update smf_messages
set body = replace(body,'”','"');

update smf_messages
set body = replace(body,'‘','\'');

update smf_messages
set body = replace(body,'•','-');

update smf_messages
set body = replace(body,'‡','c');

update smf_messages
set body = replace(body,'Â',' ');


fixed the problem in message strings however, I couldn't manage to apply the same code to the topic string by simply changing the smf_messages to smf_topics.

I am assuming there is a particular way this code needs to be modified so the query can be executed by the phpmyadmin like it did with the messages section.

Any thoughts or help much appreciated.

Thanks

Oldiesmann

To apply the same code changes to topics, change "smf_messages" to "smf_topics" and "body" to "subject".
Michael Eshom
Christian Metal Fans

mggevo

Alright,

I did change the code to

update smf_topics
set body = replace(subject,'’','\'');

update smf_topics
set body = replace(subject,'…','...');

update smf_topics
set body = replace(subject,'â€"','-');

update smf_topics
set body = replace(subject,'“','"');

update smf_topics
set body = replace(subject,'”','"');

update smf_topics
set body = replace(subject,'‘','\'');

update smf_topics
set body = replace(subject,'•','-');

update smf_topics
set body = replace(subject,'‡','c');

update smf_topics
set body = replace(subject,'Â',' ');


Placed the code



Ran the query and got this error


mggevo

ok maybe you meant to change both "body" to subject?
Like
update smf_topics
set subject = replace(subject,'’','\'');


Oldiesmann

Michael Eshom
Christian Metal Fans

mggevo

So I tried this one with no luck again :/

update smf_topics
set subject = replace(subject,'’','\'');

update smf_topics
set subject = replace(subject,'…','...');

update smf_topics
set subject = replace(subject,'â€"','-');

update smf_topics
set subject = replace(subject,'“','"');

update smf_topics
set subject = replace(subject,'”','"');

update smf_topics
set subject = replace(subject,'‘','\'');

update smf_topics
set subject = replace(subject,'•','-');

update smf_topics
set subject = replace(subject,'‡','c');

update smf_topics
set subject = replace(subject,'Â',' ');


Giving me the same error...


margarett

There is no "subject" column in smf_topics. it uses the subject of the first message in it
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair


margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

mggevo

Thank you so much! Code below did the trick and revert the gibberish characters back to its original.

update smf_messages
set subject = replace(subject,'’','\'');

update smf_messages
set subject = replace(subject,'…','...');

update smf_messages
set subject = replace(subject,'â€"','-');

update smf_messages
set subject = replace(subject,'“','"');

update smf_messages
set subject = replace(subject,'”','"');

update smf_messages
set subject = replace(subject,'‘','\'');

update smf_messages
set subject = replace(subject,'•','-');

update smf_messages
set subject = replace(subject,'‡','c');

update smf_messages
set subject = replace(subject,'Â',' ');

Advertisement: