Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: FragaCampos on June 30, 2020, 11:33:51 PM

Title: Codification problems when previewing a message
Post by: FragaCampos on June 30, 2020, 11:33:51 PM
Hi there.

When previewing a message, special characters appears like this:
(https://i.imgur.com/9eoUozz.png)


But when posting, everything is ok. I believe this happened after the recent PHP update in my server.
What can I do to correct this?
Title: Re: Codification problems when previewing a message
Post by: Deaks on July 04, 2020, 05:24:44 PM
sorry for small delay, but are you using UTF-8?
Title: Re: Codification problems when previewing a message
Post by: FragaCampos on July 05, 2020, 04:58:58 PM
Thanks for replying, Deaks.

Yes, I am. I never experienced this in years using SMF and when posting everything is ok. This only happens when previewing.
Title: Re: Codification problems when previewing a message
Post by: Deaks on July 06, 2020, 05:21:23 AM
Youmentioned you think its the php version, what version are you running?

Also go to your admin panel and convert all to utf-8 again this is long shot but may fix it :D
Title: Re: Codification problems when previewing a message
Post by: FragaCampos on July 06, 2020, 04:58:29 PM
My server's PHP version is 7.3.6.

I did as you suggested, but the problem persists.  :-\

I've noticed that 1/3 of my database has utf8_general_ci collation and 2/3 has latin1_swedish_ci collation. I think this has nothing to do with it, because nothing changed there in the last months, but could something have changed in the last SMF update because of this?
Title: Re: Codification problems when previewing a message
Post by: Arantor on July 06, 2020, 05:14:17 PM
Other than the small detail of you having UTF-8-presented-as-Latin1, you mean. Not relevant except for the fact it looks suspiciously relevant.

How did you arrive at '1/3 of my database', by looking at the table default which is a default and overridden entirely by SMF given any chance whatsoever?

What's the value of $db_character_set in Settings.php? What language are you using on the site yourself to make that preview?
Title: Re: Codification problems when previewing a message
Post by: FragaCampos on July 06, 2020, 08:17:09 PM
I arrived at 1/3 just by looking at database column collation, but I really can't tell what's relevant from what's not, Arantor.
I'm running the forum as it is for years and this problem just appeared in the last few weeks, after updating to 2.0.17, which coincided with the PHP version update.

The value of  $db_character_set is utf8.

I'm using Portuguese_pt-utf8 language to make the preview. My forum has portuguese_pt-utf8 and english "installed".




Quote from: Arantor on July 06, 2020, 05:14:17 PM
Other than the small detail of you having UTF-8-presented-as-Latin1, you mean. Not relevant except for the fact it looks suspiciously relevant.

How did you arrive at '1/3 of my database', by looking at the table default which is a default and overridden entirely by SMF given any chance whatsoever?

What's the value of $db_character_set in Settings.php? What language are you using on the site yourself to make that preview?
Title: Re: Codification problems when previewing a message
Post by: FragaCampos on July 17, 2020, 05:00:41 PM
Anyone?  :-\
Title: Re: Codification problems when previewing a message
Post by: Doug Heffernan on July 17, 2020, 09:56:53 PM
Is this happening in the previous posts only, or in the new posts too?
Title: Re: Codification problems when previewing a message
Post by: FragaCampos on July 19, 2020, 01:25:25 AM
It happens in old and new topics/messages.
Title: Re: Codification problems when previewing a message
Post by: FragaCampos on July 19, 2020, 12:18:41 PM
By the way, this doesn't happen when previewing private messages.
Title: Re: Codification problems when previewing a message
Post by: live627 on July 30, 2020, 07:45:51 AM
Might be related to a JS bug that was recently introduced. Try changing the code found in  https://www.simplemachines.org/community/index.php?topic=571082.msg4042818#msg4042818
Title: Re: Codification problems when previewing a message
Post by: FragaCampos on July 31, 2020, 11:39:10 PM
Hmmm, now that I remember, I did those edits on script.js, like shawnb61 suggests. It did solve the issue mentioned in that topic, but could it be that it produced this one I brought up here?
Title: Re: Codification problems when previewing a message
Post by: FragaCampos on August 24, 2020, 01:41:40 AM
Thanks to live627, I rechecked the changes in the topic mentioned and realized I only had done the first change.
Now that I also did the second change, everything went back to normal.

Sorry about that and thank you all for your help.