the problem is caused by ucfirst and my misconfiguration of database...
i was just testing the blog to see how well it handles chinese characters, everything seems fine except when i'm using php with mysql extension, chinese characters have trouble showing up. when im creating a category with chinese character, it will not show the character, just blank. the category is created though, just unable to click it.
then after some uninstalling and installing of php and mysql, i found out it's cause by the extension, it works totally fine with mysqli but not mysql. i have a friend that's using this blog also, and i don't think he's using mysqli, so maybe there's something wrong with my server set up.
it'd be good to use mysql extension instead of mysqli though, since coppermine gallery doesn't support mysqli.
im totally newb when it comes to this, but maybe the developers have ideas about the differences?
thanks
ucfirst & mbstring
ucfirst & mbstring
Last edited by CapriSkye on Sun Dec 12, 2004 2:35 am, edited 1 time in total.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Yes, it more likely depends on your MySQL setup and how it handles the encodings. Can you use a tool like phpMyAdmin and browse the database (serendipity_categories) to see, if the characters got properly inserted?
If they didn't get inserted correctly, there may be a superfluous call to some PHP escaping functions - but I think we don't use such messing character functions...
Regards,
Garvin
If they didn't get inserted correctly, there may be a superfluous call to some PHP escaping functions - but I think we don't use such messing character functions...
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
the category problem is gone, but the problem shown in the pic still exist.
i've narrowed down the problem, it's probably my mysql encoding. it doesn't happen to one of my friend's blog, and he has mysql version 4.0 with s9y v0.7, and i'm using 4.1. i installed both 0.8alph3 version and 0.7 version, both have the same problem. and we both using utf-8 encoding for blog language. weird stuff...
i've narrowed down the problem, it's probably my mysql encoding. it doesn't happen to one of my friend's blog, and he has mysql version 4.0 with s9y v0.7, and i'm using 4.1. i installed both 0.8alph3 version and 0.7 version, both have the same problem. and we both using utf-8 encoding for blog language. weird stuff...
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hm, to which character set and collation type did you set your s9y tables and the mysql connection? That's quite important in dealing with MySQL 4.1...
Regards,
Garvin.
Regards,
Garvin.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Ah, now I know. UCFirst is used to uppercase the first letter, and it can't deal with UTF8 character. For that, one would need the 'mb_strtoupper' function. Thinking about it, there may be a lot of other places where we use strtolower/stroupper instead of the MBstring functions. Sadly, the mb-functions are only available if the PHP extension 'mbstring' is installed, and if that is missing, one can't deal with UTF8 characters propperly.
I'll look into how many functions are affected by this...
Regards,
Garvin
I'll look into how many functions are affected by this...
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
I just patched CVS to faciliate the use of 'mbstring'. You need to make sure that the module is compiled into your PHP.
If not, there is a 'ucfirst' stub left in the file include/lang.inc.php, which you could modify like this:
to:
(but first try to enable mbstring PHP module, that is the only real way to make it work properly)
Have fun with it, and please report if there are any "strange character" issues left!
If not, there is a 'ucfirst' stub left in the file include/lang.inc.php, which you could modify like this:
Code: Select all
switch($func) {
case 'ucfirst':
// there's no mb_ucfirst, so emulate it
if ($mbstring) {
return mb_strtoupper(mb_substr($args[1], 0, 1)) . mb_strtolower(mb_substr($args[1], 1));
} else {
return ucfirst($args[1]);
}
Code: Select all
switch($func) {
case 'ucfirst':
// there's no mb_ucfirst, so emulate it
if ($mbstring) {
return mb_strtoupper(mb_substr($args[1], 0, 1)) . mb_strtolower(mb_substr($args[1], 1));
} else {
return $args[1];
}
Have fun with it, and please report if there are any "strange character" issues left!
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
No, if you activated mbstring.dll in PHP you won'T have to change anything, then it should work out of the Box
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/