• Welcome to Simple Machines Community Forum. Please login or sign up.
December 02, 2021, 03:17:49 PM

News:

SMF 2.0.18 has been released! Please update. Read more.


Problem About UTF8 at Mysql, DB etc.

Started by ankaraege, August 06, 2015, 04:50:00 PM

Previous topic - Next topic

ankaraege

Hi Guys,

I have a problem about UTF8! As you can see below, (Turkish characters) all the characters are broken and nooneknowish. I have tried to edit sql file before uploading and corrected all the unknown char's to Turkish ones but after uploading via phpmyadmin, it becomes like this again. I select UTF8 before uploading as well! How can i solve this problem? I have already tried various methots but noting changed and i tried smf>maintenance>change all the databases to UTF8 coding thing as well but i got a error and characters become more complex. So I'm out of solution :(

Sorry for mistakes..

Thanks for your helps..

Edit: Forgot to add picture


shawnb61

Was this forum working previously for you, & then started going bad?   

Or is this a new forum?

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

ankaraege

Quote from: shawnb61 on August 06, 2015, 09:58:57 PM
Was this forum working previously for you, & then started going bad?     


Or is this a new forum?


No, it's a newly builded forum. But DB is from my other forum

shawnb61

So you had a previous DB in which Turkish characters were properly displayed?

And when you moved/rebuilt the forum, do your old posts show goofy characters?   Or only your new posts?   Or everything, old & new?

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

ankaraege

Yes, actually there were no problem.. Problem occurred after i backed up all of the data from my previous site.(site is no more)

and before moving DB, i corrected all the goofy characters manually with using notepad++.  I tried to upload sql file via  and cpanel restore section, but nothing worked, after upload, characters changed itself correct ones to goofy ones. I selected UTF8 before uploading also but none of them worked.

And also i only have a problem with old posts. There is no character problem at new posts.

Topman

I have just finished checking and editing all the "goofy" characters in my 1950 posts.
I did it using the forum "modify" rather than going into the database using Notepad++

Might have taken me a few weeks (off and on), but now it's done and backed up.

ankaraege

Quote from: Topman on August 07, 2015, 03:02:30 AM
I have just finished checking and editing all the "goofy" characters in my 1950 posts.
I did it using the forum "modify" rather than going into the database using Notepad++

Might have taken me a few weeks (off and on), but now it's done and backed up.

It's not that easy for 82444 posts and 9901 topics but thanks for suggestion :))

margarett

Collation issues like those are usually caused by mismatching collations between your database and the language files you're using.

If you had a previous database, the characters might have been messed during export/move/etc (eg: your previous collation was latin1 and the dump was created with UTF8. There's no way to recover from this :( (except a manual replace like Topman had to do...)

So in order to be sure what you are running now:
* Are you using a UTF8 language pack? Does your Settings.php include $db_character_set = 'utf8';?
* What are your tables collation? (check in phpmyadmin) Then enter "smf_boards" or "smf_messages": what is the collation of the text fields?
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

shawnb61

This feels like a charset issue.  I don't think a collation issue would produce this result.  Collation dictates whether different characters are treated as equal or not on searches & queries (e.g., will 'A' = 'a' in a search, or will 'o' = 'ô'). 

Feels like a UTF8 (or UTF8MB4?) charset was stuffed into latin1 tables somehow. 

You may need to see the definition of the underlying tables themselves.   The only way I know to see it clearly is to go into myPhpAdmin and do an export.   For this purpose, it's OK to do a "Custom" export and only select the "structure" box.  You'll see something like this:

QuoteCREATE TABLE IF NOT EXISTS `smf_messages` (
  `id_msg` int(10) unsigned NOT NULL,
    .....    blah blah blah   .......
  `approved` tinyint(3) NOT NULL DEFAULT '1'
) ENGINE=MyISAM AUTO_INCREMENT=112666 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

That last line will tell you your current table's charset.  In this case, the charset is UTF8 & the collation is utf8_unicode_ci.

First & foremost, we need to know if your tables can even take Turkish characters...   If you see CHARSET=latin1, we have a bit more work to do.   
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: