Zen Cart Logo
Forums / Addon Language Packs / Problems with displaying Russian characters and UTF-8

Problems with displaying Russian characters and UTF-8

Views: 55,147

Results 1 to 20 of 32
26 Feb 2009, 12:40 PM
#1
pcontente avatar

pcontente

New Zenner

Join Date:
Jan 2009
Posts:
16
Plugin Contributions:
0

Problems with displaying Russian characters and UTF-8

Hello all!!

I have been dealing here with a problem that probably someone has already been fighting with too and I need some advisory/explanations on how can I manage to put the three languages of my website to work all together! :) I have Portugues, English and Russia. I read, in the MySQL documentation that UTF-8 supports up to 650 languages and I decided to try to use this character set for my website. So, what did I do? I created a fresh database, being its collation and character set utf8_general_ci. I exported the old database to a .sql file. Changed all the occurrences of 'latin1', the default charset of MySQL, to 'utf8'. Imported this file to the new database and voilá!! All database tables are in utf8_general_ci. Now the problems started... first, when I go to the admin area and try to create a new category, I write the category name in russian but in the database it shows up like this : > & # 1041;& # 1080;& # 1085;& # 1086;& # 1082;& # 1083;& # 1080;

It was showing up like this before, before I changed all to utf8. So, what I decided? That I could edit the field by my own... I edited and changed this bunch of characters to "Бинокли", and when I get back to the site just a bunch of "???????" shows up... With Portuguese also happens the same... all the words with punctuation shows with a ? sign, for example "Bin?culos", when it should be "Binóculos".

Can anyone tell me what is the problem? How can I put all languages compatible? How can I put the database to write Russian characters? Is it some problem in the pages when they are connecting to the database server? How to correct it? I know nothing about PHP, unfortunately ... And another problem here is that search in Russian will not work for sure if in the database all this strange characters are being written...

Thank you all for a solution to this problem...

Cheers !

1 Mar 2009, 10:42 AM
#2
pcontente avatar

pcontente

New Zenner

Join Date:
Jan 2009
Posts:
16
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

For anyone that comes up with this same problem, I managed to solve my problem in a "simple" way. I had to migrate all my site, but now everything is working, and russian and portuguese characters are being inserted into the database correctly! :clap: I am glad this problem showed up now and not in the future, let me say!

So, what did I do?

First of all, I started by reading this very useful tutorial (for me at least) http://www.srw2d.com/content/utf-8-zen-cart. Thank you!

So, after I have followed all the instructions in the link above and verified that my site was all being sent to the browsers in UTF8, I started to install the other languages. First Russian, which, fortunately, a member of this forum supplied to me in UTF8 :hug: :P. It was just the regular process of installing a language, all went fine! After installing the language and to test if russian characters were being inserted into the database correctly, I created a test category with a russian name and went to verify the database and finally all was being written correctly! Russian characters instead of a bunch of code! After installing the russian language and verifying that all was correct, it was time for the portuguese language. This gave me a bit more work, because I had to edit all files and convert them to UTF8. But ok, now all is working too!

After my languages were working fine it was time :yuck: to migrate all my old site to this new. template, settings, database. gave me some work but after 2 days, more or less, all was complete and the site is again healthy and all is being encoded properly. Search is also working for the 3 languages and I am very happy with it!! :) :clap:

:bigups:

1 Mar 2009, 12:19 PM
#3
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Problems with displaying Russian characters and UTF-8

Well done of getting to the bottom of a complex and difficult issue.

Thanks for taking the time to post this explanation and show not only how to resolve the issue, but also what a little persistence and research can do, and how much help is out there even if it's not always easy to to uncover.

:thumbsup:

1 Mar 2009, 10:05 PM
#4
pcontente avatar

pcontente

New Zenner

Join Date:
Jan 2009
Posts:
16
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

:smile: :thumbsup:

2 Mar 2009, 8:59 PM
#5
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

Hi pcontente,

Glad my little tutorial helped you there. Sorry I didn't see your question on here before you had to bang your head on your desk. But, that way is sometimes the best. It's nice after you can't do it for a couple of days, and then you find something, and it works.

Also great post, its always nice when people post their answers.

Regards,

CKD

20 Jul 2009, 11:00 PM
#6
hlubach avatar

hlubach

New Zenner

Join Date:
Jun 2008
Posts:
29
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

I have done all things as describde.In an English template i can write Russian characters (example "category" Тюдпаны) but when i change to a Russin language template then the Russian is like arabic unreadable ( category " Тюлпаны" .
If i look in the russian Template
Page source is charset=windows-1251
Character encoding is cyrillic windows 1251
In the English one utf8
What do i wrong

Han

20 Jul 2009, 11:28 PM
#7
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

If you set the browser to the correct encoding, does it work?

For example, in FireFox go to "View->Character Encoding->Find the correct encoding here."

Does that work for you? Are you working on a live server and have a url you can give us?

Can you post the source code that shows that gets printed to the browser?

example:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

All that info should help me know what is going on.

Regards,

CKD

22 Jul 2009, 9:13 AM
#8
hlubach avatar

hlubach

New Zenner

Join Date:
Jun 2008
Posts:
29
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

Категории
Тюлпаны->
Все товары
Отзывы [далее]
Нет отзывов
Информация

* Отгрузка и возврат товара
* Уведомление о секретности
* Условия использования
* Обратная связь
* Карта сайта
* Дисконтные карточки[Помощь]
* Дисконтные карточки
* Отписатся от новостной рассылки

This is a part of the template in russian, I have followed the instruction .
Ckanged the php to utf8 etc
If i use only English then all thing are shown correct even with Russian characters
see below

*  Тюлпаны

Categories
Тюлпаны->
All Products ...
Reviews [more]
There are currently no product reviews.
Information

* Shipping & Returns
* Privacy Notice
* Conditions of Use
* Contact Us
* Site Map
* Gift Certificate FAQ
* Discount Coupons
* Newsletter Unsubscribe

So the problem is in the language for filling the category changing the russian php gave no result
In the russin php
@setlocale(LC_TIME, 'ru.utf8');
define('CHARSET', 'windows-1251');
What can i do to get a readable Russian character in the catalog
I need much things in there at least 51 pages and with abracadabra it does not sell anything

Han

22 Jul 2009, 9:39 AM
#9
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

Hi,

your problem is that you need to change winows-1251 to utf-8.

Regards,
CKD
Posted via Mobile Device

22 Jul 2009, 11:33 AM
#10
hlubach avatar

hlubach

New Zenner

Join Date:
Jun 2008
Posts:
29
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

If i do that this is wat i get

���������
Тюлпаны->
��� ������
������ [�����]
��� �������
����������

* �������� � ������� ������
* ����������� � �����������
* ������� �������������
* �������� �����
* ����� �����
* ���������� ��������[������]
* ���������� ��������
* ��������� �� ��������� ��������

The category is now russian but the rest unreadable

22 Jul 2009, 11:44 AM
#11
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

Is your database in unicode? If you go into your database and find the same text, can you read it there?

What I am guessing is one of two things. One, you made this content before you fixed the problem, and now because of that, you can't read it, because it was never not in the right encoding when you entered it into the site or you didn't edit this file, includes/classes/db/mysql/query_factory.php .

So, let me know,

CKD

29 Jul 2009, 1:44 PM
#12
hlubach avatar

hlubach

New Zenner

Join Date:
Jun 2008
Posts:
29
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

The first thing i did was making a db in utf-8
Then i changed the two languagefiles accordig to the writtem statement after that change the query.php
try again to start from scratch to see if something changes

29 Jul 2009, 2:30 PM
#13
hlubach avatar

hlubach

New Zenner

Join Date:
Jun 2008
Posts:
29
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

Lokked into the database is utf80-gen

Character encoding English template/language utf8 also the Page source.
Now i change to russian language in the template, then the page is in Russian but the langiuage
Character encoding cyrilic 1251 also page source
If i now go to the catalog and create a new catalog in english no problem but in russin it is still abracadabra

9 Aug 2009, 12:13 AM
#14
davide avatar

davide

New Zenner

Join Date:
Jun 2008
Location:
Rome
Posts:
4
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

CrystalKoi:

Is your database in unicode? If you go into your database and find the same text, can you read it there?

What I am guessing is one of two things. One, you made this content before you fixed the problem, and now because of that, you can't read it, because it was never not in the right encoding when you entered it into the site or you didn't edit this file, includes/classes/db/mysql/query_factory.php .

So, let me know,

CKD

hi there...

Hi, well finally i find the heart to have a go at this problem. and what is happening is summerised rightly in your post.
The japanese is fine now, is in utf-8.

The russian not. I did follow religiously your instructions and modified the files accordingly. the result is that now, i can write in Russian in the control panel, and it would show up properly in the browser (in the browser it shows encoding utf-8) but everything else (the information sidebox, home, login,...the modules basically) show up in unreadable characters (these lovely question marks with a black diamond shaped backgrounds).

this was not a fresh install, i just modified the files as described in your tutorial, and didn't need to touch the database as was already in utf-8_general_ci.

so I summarise: writing in russian works fine now from control panel, no contrast with japanese or other languages, but module headings and menus are unreadable.

I tried to modify manually, module headings and menus (using the developer tool kit, finding the lines and make modification by hand) but still doesn't work (intersting is, dreamweaver gives me a message as to save the file with utf-8 encoding. I get question marks. tried to change the setting in the browser, clearing the cache...to no avail.

any suggestions would be greatly appreciated.

cheers

23 Aug 2009, 6:45 PM
#15
hlubach avatar

hlubach

New Zenner

Join Date:
Jun 2008
Posts:
29
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

d all the steps as described in the tutorial
The database is utf 8
The 3 php files changed
The browser say utf 8
Download the russian langauge pack install it and what is the result a nice russian page but now it comes i make an new categry in the russian language an what do I see yes garbadge

Категории
Тюлпаны
Все товары
Отзывы [далее]
Нет отзывов
I take a look to character encoding this is Cyrillic (windows1251)
And page source charset=windows-1251
I can not understand why i have a nice russian page but if i will write something in Russian then Zencart say do it yourself

How cn it be that this problem is in the last 1.5 years not solved

29 Jul 2010, 11:49 AM
#16
clava avatar

clava

New Zenner

Join Date:
Jul 2010
Posts:
8
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

Hello!
By my expirience, after making all of steps from Tutorial, it is need to save each file that contents russian words, in UTF-8 Encoding and replace all that files on site. :mellow:

2 Aug 2010, 6:59 PM
#17
ringlas avatar

ringlas

New Zenner

Join Date:
Aug 2010
Posts:
2
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

clava:

Hello!
By my expirience, after making all of steps from Tutorial, it is need to save each file that contents russian words, in UTF-8 Encoding and replace all that files on site. :mellow:

Excuse me, can someone, please, send me or pm me a link for the Russian language pack in utf-8 collation? I also have the same trouble, so I was wandering if someone could be kind enough and send me one ^^

Thanks to whoever responds!

3 Aug 2010, 7:33 AM
#18
clava avatar

clava

New Zenner

Join Date:
Jul 2010
Posts:
8
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

ringlas:

Excuse me, can someone, please, send me or pm me a link for the Russian language pack in utf-8 collation? I also have the same trouble, so I was wandering if someone could be kind enough and send me one ^^

Thanks to whoever responds!

http://www.zen-cart.com/forum/showthread.php?t=73194
May be here can you find authors of russian pack... :smile:

But so far this pack is not UTF, imho.

3 Aug 2010, 8:24 AM
#19
ringlas avatar

ringlas

New Zenner

Join Date:
Aug 2010
Posts:
2
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

clava:

http://www.zen-cart.com/forum/showthread.php?t=73194
May be here can you find authors of russian pack... :smile:

But so far this pack is not UTF, imho.

thank you for your fast response! i used this pack, yes. but what I have to do in order to make it utf-8 is to save each file from include directory with my Dreamweaver with changed page properties to utf-8, is that so? plus change the collation in the main russian.php into utf8 and not cp1251.rus

5 Aug 2010, 7:25 AM
#20
clava avatar

clava

New Zenner

Join Date:
Jul 2010
Posts:
8
Plugin Contributions:
0

Re: Problems with displaying Russian characters and UTF-8

ringlas:

thank you for your fast response! i used this pack, yes. but what I have to do in order to make it utf-8 is to save each file from include directory with my Dreamweaver with changed page properties to utf-8, is that so? plus change the collation in the main russian.php into utf8 and not cp1251.rus
Yes, I was open each file from this pack in my text editor (be sure what editor show real russian letters) and save as UTF 8 with same name. Then upload files to their place on the site through ftp.
Also i was make all the steps from tutorial srw2d.com/sites/default/files/utf-8-zen-cartV1.3.8.pdf (some distinction was in file query_factory.php - it need to find a place for UTF section paste:smile:).