At least, garbled characters occur in sidebar when using the internal plugin "serendipity_archives_plugin" and the sidebar plugin "serendipity_plugin_comments".
There are two possible reasons why the garbled characters occur: 1. the web server doesn't support mb_string module; 2. PHP functions like "wordwrap" etc don't support for multibyte strings.
Here are the solution I found to solve the problem. The solution works for s9y v0.8.x to v1.0.
1. For internal plugin "serendipity_archives_plugin":
In file "./include/lang.inc.php", check line 63 (in function serendipity_mb()). The original code is:
Code: Select all
return mb_strtoupper(mb_substr($args[1], 0, 1)) . mb_substr($args[1], 1);
Code: Select all
return mb_strtoupper(mb_substr($args[1], 0, 1, mb_detect_encoding($args[1])), mb_detect_encoding($args[1])) . mb_substr($args[1], 1, mb_strlen($args[1], mb_detect_encoding($args[1])), mb_detect_encoding($args[1]));
In file "...../serendipity_plugin_comments.php, from line 153 to line 202 (in function generate_content(&$title)). Modify the following:
2.1. replace "$serendipity['lang'] == "ja"" to
Code: Select all
($serendipity['lang'] == "ja" || $serendipity['lang'] == "cn" || $serendipity['lang'] == "zh" || $serendipity['lang'] == "ko" || $serendipity['lang'] == "tw" || $serendipity['lang'] == "tn")
For exmaple:
Original source code:
Code: Select all
mb_strlen( $comment)
Code: Select all
mb_strlen( $comment, mb_detect_encoding($comment))
http://www.deminy.net/blog/archives/4214-y.html