Rev. 2009-07-06
I wanted to start a blog that contains both English and Russian characters. It might occasionally use other Unicode characters, so UTF-8 seeemed the best character set. I also wanted to use open source software, and because I had previously played with it briefly, I chose b2evolution. Getting it to work right was much trickier than the forum postings on b2evolution.net had led me to believe. In fact it took about a week of headcracking, and that was even with the help of some kind forum members. Here's a detailed account of how I got it to work.
Before you do anything else, you will need a webspace host that provides PHP scripting and MySQL. I use 1and1.com, and frankly I've been entirely happy with them. They provide phpMyAdmin for some of the MySQL manipulation.
$db_config = array( 'user' => 'dbo#######', // your MySQL username 'password' => 'mypasswordhere', // ...and password 'name' => 'db########', // the name of the database 'host' => 'db####.perfora.net', // MySQL Server (typically 'localhost') );with my username, password, etc. All those hash marks (#) I replaced with the appropriate numbers for my account.
$force_io_charset_if_accepted = ''; $db_config['connection_charset'] = '';with
$force_io_charset_if_accepted = 'utf-8'; $db_config['connection_charset'] = 'utf8';
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">I added that because the blog wouldn't render for one of my viewers and this resolved his issue.
evo_antispam aspm_string evo_items__item post_content post_title post_urltitle post_url post_excerpt evo_items__prerendering itpr_renderers itpr_content_prerendered evo_comments comment_author comment_content
That's it. As you can see, the process wasn't trivial, but it worked on the whole.
The modifications mentioned above worked on the whole, but they left a defect: the notification messages that were sent to the author of a posting when a comment was made on the post did not correctly display Russian. I have still not been able to fix the subject lines of those messages, but I have successfully enabled Russian in the body of those messages. This is a hack, but it works so far. The following changes had to be made in \inc\_core\_misc.funcs.php:
Original |
My changes |
I inserted this line before the next Content-Type line:$headers['MIME-Version'] = '1.0' ; |
|
$headers['Content-Type'] = 'text/plain; charset='.$current_charset; |
$headers['Content-Type'] = 'text/plain; charset=UTF-8' ; |
$subject = mb_encode_mimeheader( $subject, mb_internal_encoding(), 'B', $NL ); |
$subject = mb_encode_mimeheader( $subject, 'UTF-8', 'B', $NL ); I actually don't think this change did any good. |
$message = convert_charset( $message, $current_charset, $evo_charset ); |
I commented this line out. The databases are all in UTF-8, so no converstion should be necessary. |
<font size='+2' color='red'>Warning!</font> This comment is vulgar. Click <a onclick='document.getElementById("c20091126a").style.color="#000000";'>here</a> if you want to read it.<br /><br /> <div id='c20091126a' class='vulgar'> Vulgar content </div>