hi, there, i have problems that i dun understd and dunno where to start to look for it. so i posted here, if anybody knows, pls tell me.
would really appreciate it.here is my question:
my table 'bbs' contains :
bbsid
name
date
msg
name and msg both the collation is : utf8_unicode_ci
and the type for
name : varchar(20)
msg : text
now i can display the chinese character in browser,
i just wan to know, if i type english word in name, then i can only have 20 words there, but when i type chinese it will not have
20 chinese character.
i just want to know why.
and then i have a second question:
when bbs.php in browser i can view the chinese character.
but when i in php myadmin, why i see only strange code? how to solve this problem?
thanks.
thanks in advance who ever ans my question. ^^
chinese character problems
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
unicode characters are "multibyte" characters - which means they can be represented by one or more bytes. In the case of Chinese characters they take up 2-3 bytes on average (I think).
In SQL what you're setting is the byte length of the field, not the character length. This is often overlooked since English characters are all exactly one byte long.
As for phpMyAdmin, you'll have to check it's settings.
In SQL what you're setting is the byte length of the field, not the character length. This is often overlooked since English characters are all exactly one byte long.
As for phpMyAdmin, you'll have to check it's settings.