Page 1 of 1
Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 2:17 am
by captaincoo
I'm using the CMSMS 1.2.4(i bet it's nothing reative with the version) in simple chinese, after smoothy going installation, and i got sth not good: the site name ( which showing at the top of the browser) goes like this--挖店导航?--i have to say ,the name of my site is 5 chinese character length, and now, the 5th character become a "?". and then, i found something more :not only the site name, every thing i type in my site:the title of a news,the name of a menu,and even the content of a article,all things get the same promble. i know it's the utf8 issue.----chinese character use 3 byte to show a right word, then, if the title or words is an odd number , the last one will become "?" or something esle(#$@%), and if when in case it is an even number, things go well.
so , could anybody tell me how to deal with this promble? thanks a lot!

Re: Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 2:41 am
by Wiedmann
chinese character use 3 byte to show a right word
Just to have the same as you.... can you post all 5 chars as byte sequence (or unicode position)?
(Because this forum convert all to entities, and I don't know if they are correct... see the "?" at last.)
Re: Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 3:33 am
by captaincoo
THANKS for replying. i sorry , i fogot that you and other foreign buddy can't not see the chinese on your browsers.so now i upload a screenshot here [ the attachment]. maybe you know what i meant now

Re: Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 3:40 am
by captaincoo
or is it possible that i just re- code all .php of CMSMS as ANSI ( utf-8 -->ansi) and solved the promble?

Re: Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 3:42 am
by Wiedmann
Let me ask in another way:
What is the correct 5th character?
(I want insert the wrong character in my own installation, but I need the correct character code.)
Re: Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 4:03 am
by captaincoo
挖店导航网
it's my site name. the 5th one is 网
测试奇数字标题
Posted: Tue Apr 22, 2008 4:26 am
by captaincoo
此回复用于测试奇数字帖
this reply for testing odd number of the title
Re: Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 4:27 am
by captaincoo
:-[it goes well on this site but not mine. why? how can i fix it??
Re: Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 4:54 am
by Wiedmann
it goes well on this site but not mine.
Curious, in my fresh testinstallation this is also working well.
You have more details?
- meta "Content-Type"
- used fonts
- db?
- table charset in db?
Re: Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 8:34 am
by captaincoo
Here are more detail of my settings of the admin site and the date base table.
I guess it might be sth. wrong with the database table, you can see it from the attachment(screenshots).
Is it a real problem for that? And how can I deal with that??
THX!!

Re: Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 9:23 am
by Wiedmann
Well, if you install cmsms, you should first create a new db for it and then set the default charset for this db to 'latin1'. After that you can install cmsms in this db and use all (chinese) chars you want. Don't change the db/table charset after installation to something else. (in config.php from cmsms also don't change "$config['default_encoding']" or change meta charset utf-8 in cmsms global settings).
BTW:
In phpMyAdmin you can use utf8_general_ci for the connection, it's faster then utf8_unicode_ci (and utf8_unicode_ci is not necessary most times).
Re: Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 5:44 pm
by captaincoo
thanks.
i follow your guide.but still not solved my issue. :'(here are my steps:
1. use utf8_general_ci for the connection
2. created a db which uses latin1_swedish_ci(for the first test I used latin1_swedish_ci, it didn't work; and then the second time latin1_general_ci,still failed)
3. reinstall the cmsms, didn't change anything(easpecially the meta,utf-8) for the settings.
4. after finished installation, for the "global setting" I select the language as "Chinese Simplified"
5. change the site name into Chinese characters, still not worked.
I entered db to check my site name in this table "cms_siteprefs", the site name just displays like this “:?&¥#@&*?”.
there is another xoops db at the same server, it uses "utf8_general_ci", and the Chinese characters in xoops have been running very well.(I have another part of my site uses the xoops cms. it has been running well without this problem.)
Since I noticed that, after I had changed cmsms db into "utf8_general_ci" and tried to reinstall cmsms again.It didn't work.
This time my site name in the cmsms db goes like this "鎸栧簵瀵艰埅缃"(not Chinese characters), in the front end goes likes "挖店导航?“(The question mark should be Chinese character"网")
So dear Wiedmann, heve you got any ideas about that?? I really need your help.
Re: Need help:utf 8 promble in chinese
Posted: Tue Apr 22, 2008 6:18 pm
by Wiedmann
4. after finished installation, for the "global setting" I select the language as "Chinese Simplified"
You mean the select with "Default language for the frontend:"? Sorry, I've never changed this value from "No Default Selected".
Just make sure you have:
Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
in "Global Metadata:".
5. change the site name into Chinese characters, still not worked.
Have you also tried to add some Chinese chars in page content?
BTW:
In the browser title bar I also can't see the chars, but that's normal for me, because my system font don't have glyphs for these unicode chars. But in the webpage content or menu the Chinese chars works well (my browser can use such an unicode font).
**UPDATE**
After a test: If I change my system font to a full unicode font, I can also see these chars in the browser title bar.
But I can see the correct chars in the browser source code.
I entered db to check my site name in this table "cms_siteprefs", the site name just displays like this “:?&¥#@&*?”.
That's normal for a cmsms db. You can't edit these cmsms tables with phpMyAdmin (if the columns contains utf-8 chars)
--> cmsms is not aware of unicode databases and only stores utf-8 byte sequences (1-3 latin1 chars) in latin1 tables. (You must change a little bit in the db and cmsms, if you also want have correct utf-8 chars in e.g. phpMyAdmin)
(Is this a live webserver thus we can have a look?)