Advertisement:

Author Topic: UTF-8 Error  (Read 537 times)

Offline crows

  • Newbie
  • *
  • Posts: 5
UTF-8 Error
« on: August 05, 2019, 07:29:57 PM »
Hello! My website went through some errors with AE-type symbols, and my admin and I are attempting to fix it. We're dealing with errors that it looks to be related to UTF-8, and so we tried to update our site to the UTF-8 language. Our cpanel tells us, however, that we're already on UTF-8, while our site says that we're not. Any attempts to update to UTF-8 on our site ends in this error:

Quote
Duplicate entry 'maintenance-21966' for key 'PRIMARY'
File: /home/bearbone/public_html/Sources/ManageMaintenance.php
Line: 666

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.13, while your database is at version 2.0.12. The above error might possibly go away if you execute the latest version of upgrade.php.

We're trying to avoid updating, as we have an important sub-account mod that we're concerned won't transfer. However, we want to fix this AE symbol error to avoid this event from happening again (and potentially fixing the posts affected). Does anyone have any advice?

Apologies for anything confusing or vague, I am not a coder by any means and a lot of this terminology is very new to me. '^^

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,154
Re: UTF-8 Error
« Reply #1 on: August 05, 2019, 09:46:43 PM »
The database upgrade message can be ignored.  Are your database and tables at utf-8 when you view them in phpmyadmin?

Offline crows

  • Newbie
  • *
  • Posts: 5
Re: UTF-8 Error
« Reply #2 on: August 05, 2019, 10:59:49 PM »
Yes! The server says that our tables are "utf8_general_ci" and our server connection collation is "utf8mb4_unicode_ci"

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,154
Re: UTF-8 Error
« Reply #3 on: August 05, 2019, 11:23:39 PM »
Look in Settings.php, does it contain this line?

Code: [Select]

$db_character_set = 'utf8';


Offline crows

  • Newbie
  • *
  • Posts: 5
Re: UTF-8 Error
« Reply #4 on: August 06, 2019, 02:09:21 AM »
I am so sorry, I'm having a hard time finding Settings.php and google/searches isn't helping much - where is it located?

If it's not in the line of code, should I add it in?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,333
  • Gender: Male
    • Kindred-999 on GitHub
Re: UTF-8 Error
« Reply #5 on: August 06, 2019, 03:18:37 AM »
Settings.php is in the root of your forum
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,154
Re: UTF-8 Error
« Reply #6 on: August 06, 2019, 03:51:25 PM »
If it's not in the line of code, should I add it in?

Yes.  When you do the utf-8 conversion in admin, it adds that line.  If your database is utf-8 and it's not in Settings.php, the forum won't recognize utf-8.

Offline crows

  • Newbie
  • *
  • Posts: 5
Re: UTF-8 Error
« Reply #7 on: August 10, 2019, 05:42:27 PM »
Thank you all! We put it in - is there a way to resolve the AE symbols, or will we manually need to fix those themselves?

Online shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,275
    • sbulen on GitHub
Re: UTF-8 Error
« Reply #8 on: August 10, 2019, 06:08:25 PM »
Are the issues only in message bodies, or are they elsewhere, e.g., topics?

I've been working on a script to fix these.  If interested, let me know. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline crows

  • Newbie
  • *
  • Posts: 5
Re: UTF-8 Error
« Reply #9 on: August 11, 2019, 12:56:12 PM »
They’re in our topics and messages! I would definitely be interested in anything to fix it without having to go in manually.

Online shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,275
    • sbulen on GitHub
Re: UTF-8 Error
« Reply #10 on: August 11, 2019, 07:01:12 PM »
Here is the utility I have been using. 

Please read the notes in there carefully.  BACKUP your system first! 

https://github.com/sbulen/sjrbTools/blob/master/smf_fix_dbl_enc_deep.php

This only does message bodies.  If this works for you, I can look at one for topics as well.  Let me know how it goes. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp