Recent Topics

1 Jan 15, 2008 03:03    

In 2.3.0 rc1 (and other older versions also).
$_SERVER['HTTP_ACCEPT_CHARSET'] is used at

./inc/locales/_locale.funcs.php:895: || preg_match( '~\b(\*|'.$force_io_charset_if_accepted.')\b~', $_SERVER['HTTP_ACCEPT_CHARSET'] ) )

This line causes problem for some users because it does not ignore case.

For example, most of browsers use lower case for 'UTF-8' encoding, i.e. 'utf-8' for UTF-8 encoding. However, some users specify accept charset by themselves and set it to "UTF-8,*" for instance. According to IANA charset name registration, UTF-8 encoding name is 'UTF-8' (case sensitive), so I suppose the setting is valid. However, since b2evolution does not ignore case, the if statement fails and invalid characters are sent to browsers.

I've got 2 people reporting this problem.

POSSIBLE SOLUTION:
ignore case in the if condition.

./inc/locales/_locale.funcs.php:895: || preg_match( '~\b(\*|'.$force_io_charset_if_accepted.')\b~i', $_SERVER['HTTP_ACCEPT_CHARSET'] ) )

ANOTHER POSSIBLE SOLUTION:
It seems b2evolution does some conversion which it should not supposed to do. Fixing this problem should also fix this problem.
(I use only UTF-8 encoding and specified encoding in locale setting file.)

2 Jan 15, 2008 03:16

There is also a known problem with the difference between utf8 and utf-8. Do you know where that originates?

3 Jan 15, 2008 10:16

mysql use charset name "utf8" and php "utf-8"


Form is loading...