Recent Topics

1 Mar 16, 2009 00:55    

When a user is logged in and there are non-latin characters in the first, last, or nickname fields, these will not be saved correctly in the user object.

For example, in the _item.class.php file in inc/items/model I was experimenting with the following code snippet:

echo $this->creator_User->nickname;

Assuming there were non-latin characters entered for my nickname and I was logged in, this would render as ???. If, however, I were to log out, it displays correctly.

This is also visible from within the admin pages on the user detail screens. I can set any other user's names to have non-latin characters and they display correctly. However, when I set my own name, it displays as ????. When the user list is viewed instead of the detail screen, everything renders correctly.

Note: the backend db is set to use UTF for the columns.

2 Mar 16, 2009 01:17

Hi tselliot,

In one of the pages where you can view the echo please try:

global $current_User;
pre_dump($current_User);


This is the cache and it's used nearly everywhere. I suppose that refers to the pages where you view correctly.

I think the User page comes directly from the database and isn't converted. You may want to check the DB.
As always with charset troubles it's hard to tell who's to blame. The DB charset, B2evo charset or even your browser or OS.
Do check the /config/_locales.php for the charsets that are supposed to be used.

If you can report this information back to this forum I will check the User detail page.

good luck

*edit*
Please also try

pre_dump($edited_User);


in /inc/users/views/_user.form.php. After checking some code I think this $edited_User is to blame

3 Mar 16, 2009 06:07

Note: the backend db is set to use UTF for the columns.

Did you also set utf-8 in /config/_locales.php ?

Edit the following in /config/_locales.php

$force_io_charset_if_accepted = 'utf-8';
$db_config['connection_charset'] = 'utf8';

4 Mar 16, 2009 10:57

sam2kb wrote:

$force_io_charset_if_accepted = 'utf-8';
$db_config['connection_charset'] = 'utf8';

That actually seems to have done the trick. I had the $db_config['connection_charset'] set at utf-8 instead of utf8.

Thanks for the help!

Also, just to note it here, the $current_User was the one with the ???. $edited_User contained the correct Cyrillic characters even when I had the connection_charset set incorrectly.

5 Mar 16, 2009 11:54

Hi tselliot,

Thanks for the feedback.
Since this is not a bug I'm gonna move this post to 'Support' to not confuse other developers.

Thanks sam2kb also.

Good luck


Form is loading...