drupal character set is utf-8, so I can use china ID for user.
now, I use drupal 4.7 + phpbb module, ID coding error in phpBB2.
This is a critical question for many people in world.

Comments

arkepp’s picture

Component: User interface » Code
Assigned: Unassigned » arkepp
Priority: Critical » Normal
Status: Active » Closed (works as designed)

The module defaults to ISO-8859-1 since that is the default character encoding of phpBB (last time I checked), so I don't consider it a bug.

However, I have made provisions to make it easy to change this.
The quick version:
Open phpbb.module in a text-editor and replace all occurences of ISO-8859-1 with whatever charset you wish to use. There should be 5 replacements.

The long way (recommended):
Take a look at line 356:
function _phpbb_encode($astring)

and at line 370:
function _phpbb_decode($astring)

Replace ISO-8859-1 with the charset you use in phpBB. This works for any converter except utf8_decode. utf8_decode does not support any other charsets, so make sure you have one of the other converters installed.

arkepp’s picture

I should add, if you use the same encoding in both applications you could just change the functions to

function _phpbb_encode($astring) {
return addslashes($astring);
}

function _phpbb_decode($astring) {
return $astring;
}

rill’s picture

yes, When I make utf8 as mysql default character set, the error is clear. and I donot modify the phpbb.module file.

Now I can use and style ID for drupa and phpbb user, thank you very much.

For phpbb.module install note, you can advice use utf8 for mysql default character set.

I remake mysql as: make with_charset=utf8