Converting data - success but strange encoding

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
zilonitiz
Registered User
Posts: 50
Joined: Wed May 23, 2007 5:53 am

Converting data - success but strange encoding

Post by zilonitiz »

Hello all!

I have successfull converting data from 2.19 to RC1 but my data have starnge encoding Âîïðîñû ïî ðà áîòå ñ ïîðòà ëîì. My old forum use russian languages in system and postas etc... Where can be problem? As I can understand somthing wrong with converting data from cp1251 to UTF8 or may be server missconfigured. Any one can help me?
User avatar
IronEyes
Registered User
Posts: 47
Joined: Wed Nov 05, 2003 8:54 am

Re: Converting data - success but strange encoding

Post by IronEyes »

I have the same problem but with arabic letters! i get questions marks instead of the letters "???????????"
the weird thing is that.. on my database it is ?????????????????????? whil on the board it appears correctly!

this is still big problem bcoz when i use phpmyadmin to take a backup i get the back up with the ???????????? instead of the real letters... im not able to take the backup correctly and there is no way to set the phpmyadmin charset to UTF-8.. what shall i do?

should i play with the phpBB code to change the UTF-8 to something else that suits me be4 i do the converting? (like the win1256 i used to have with my phpBB2) or? whats r ur advices?
User avatar
Alexandre
Registered User
Posts: 68
Joined: Fri Feb 03, 2006 3:05 pm
Location: Gomel, Belarus
Contact:

Re: Converting data - success but strange encoding

Post by Alexandre »

If the letters still correct at the screen, then all is correct except the settings of phpMyAdmin. You have to put correct language setting (i think utf-8) in the phpMyAdmin settings.
User avatar
IronEyes
Registered User
Posts: 47
Joined: Wed Nov 05, 2003 8:54 am

Re: Converting data - success but strange encoding

Post by IronEyes »

Alexandre wrote:If the letters still correct at the screen, then all is correct except the settings of phpMyAdmin. You have to put correct language setting (i think utf-8) in the phpMyAdmin settings.
I thought of doing that, but the phpmyadmin Globat is proving me with does not has the option of UTF-8. Should i ask them to make that available or whats the solution?
zilonitiz
Registered User
Posts: 50
Joined: Wed May 23, 2007 5:53 am

Re: Converting data - success but strange encoding

Post by zilonitiz »

I not use phpMyAdmi etc...

IronEyes, if you mysql serviver is 4.1.X version try find correct configuration information.

But what about my problem?
zilonitiz
Registered User
Posts: 50
Joined: Wed May 23, 2007 5:53 am

Re: Converting data - success but strange encoding

Post by zilonitiz »

Any one?
User avatar
Larrodan
Registered User
Posts: 28
Joined: Thu Mar 23, 2006 10:28 am
Location: Hungary
Contact:

Re: Converting data - success but strange encoding

Post by Larrodan »

Before install

1.
in your 2.0 root/language/lang_x/lang_main.php
find:

Code: Select all

$lang['ENCODING'] = 'utf8'; 
and replace 'utf8' to yours

2
if you use mysql_41_schema
in mysql_41_schema.sql
change all

Code: Select all

) CHARACTER SET `utf8` COLLATE `utf8_bin`;
to yours

3.
With this query you can change your tables char set, and collate

Code: Select all

ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
Always make backup before run character set conversion!
While I nodded, nearly napping, suddenly there came a tapping,
As of some one gently rapping, rapping at my chamber door.
`'Tis some visitor,' I muttered, `tapping at my chamber door -
Only this, and nothing more.'
trv
Registered User
Posts: 64
Joined: Sun Nov 07, 2004 4:39 pm

Re: Converting data - success but strange encoding

Post by trv »

I have a similar, but a little bit more complicated problem!

I have a phpbb 2.0.22 forum (greek language forum) that is encoded with latin1 encoding, but everything is displayed fine. (except with phpmyadmin).

This forum was an old invision bower board v.1 that was converted to phpbb at some point some years ago.

Everything with using phpbb2.0.22 is fine, everything is displayed correctly.

The problem:

After converting to phpbb3 rc1, some posts in greek are OK, but some are not! Several posts display with not understandable characters like those posted above.

My guess is that that posts are posts existing in the older invision power board, but I may be wrong.

I cannot understand how, since everything seems fine in phpbb2, during the convertion from latin1 to uft8_bin that is automatically done during the convert, some posts are correctly converted, and some of them are not!

Please help....

Should I try to convert everything to utf8_general_ci using phpbb2.0.22 first, prior to converting to phpbb3?

[ So that the forum already uses utf8 and the converter does not have problems ]

How can that be done?

Thank you!
zilonitiz
Registered User
Posts: 50
Joined: Wed May 23, 2007 5:53 am

Re: Converting data - success but strange encoding

Post by zilonitiz »

Larrodan wrote:Before install

1.
in your 2.0 root/language/lang_x/lang_main.php
find:

Code: Select all

$lang['ENCODING'] = 'utf8'; 
and replace 'utf8' to yours

2
if you use mysql_41_schema
in mysql_41_schema.sql
change all

Code: Select all

) CHARACTER SET `utf8` COLLATE `utf8_bin`;
to yours

3.
With this query you can change your tables char set, and collate

Code: Select all

ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
Always make backup before run character set conversion!
Do you have read my first post?!
zilonitiz
Registered User
Posts: 50
Joined: Wed May 23, 2007 5:53 am

Re: Converting data - success but strange encoding

Post by zilonitiz »

Any one can help me or no? :o
User avatar
Ash Hi Fi Zone
Registered User
Posts: 409
Joined: Fri Feb 09, 2007 11:55 am

Re: Converting data - success but strange encoding

Post by Ash Hi Fi Zone »

As you have mentioned the problem seems to be in the encoding part.... The tables created might have been created using the wrong encoding and hence you would need to convert all the created tables to the correct one you are using like cp1251or something else.....
zilonitiz
Registered User
Posts: 50
Joined: Wed May 23, 2007 5:53 am

Re: Converting data - success but strange encoding

Post by zilonitiz »

Yes, I think to, problem in converting data but my sql server have this config:
character set client utf8
character set connection utf8
character set database utf8
character set results utf8
character set server utf8
character set system utf8
character sets dir /usr/share/mysql/charsets/
collation connection utf8_general_ci
collation database utf8_general_ci
collation server utf8_general_ci
As I can right understand that is right for server configuration.
olehl
Registered User
Posts: 1
Joined: Wed Jun 06, 2007 9:15 pm

Re: Converting data - success but strange encoding

Post by olehl »

zilonitiz wrote:Hello all!

I have successfull converting data from 2.19 to RC1 but my data have starnge encoding Âîïðîñû ïî ðà áîòå ñ ïîðòà ëîì. My old forum use russian languages in system and postas etc... Where can be problem? As I can understand somthing wrong with converting data from cp1251 to UTF8 or may be server missconfigured. Any one can help me?
Hello, I am from Ukraine and also used cp1251 encoding in my older versions of phpbb. Since I switched to version 3RC1 database was also converted to UTF8.
If you check this page - http://area51.phpbb.com/docs/coding-guidelines.html they explaining that With phpBB3, the output encoding for the forum in now UTF-8 and the language files for phpBB must now also be encoded as UTF-8..

Since we have to follow new rules, my suggestion for you is:
- check if encoding in your forum is set to UTF8
- check if all forum tables have "collation" set to utf8_general_ci
- also double check if phpMyAdmin encoding is UTF8

I dont see any other solution for your problem. It should work fine.

P.S. I just updated my forum today (June 6th) and everything went smooth. Try to download latest update of v3.
Locked

Return to “[3.0.x] Support Forum”