Skip to:
Content
Pages
Categories
Search
Top
Bottom

Problem in displaying utf8 characthers from wp_usermeta


  • Milan Dinić
    Participant

    @dimadin

    I have problem in displaying utf8 characters from wp_usermeta. My bbPress 0.9 installation is integrated with WordPress 2.7 and uses wp_users and wp_usermeta tables from WordPress.

    I use this hack to display information about user that is stored in WordPress built-in fields like first_name and last_name on profiles page. Also I use bb_get_usermeta function to print that data below username on topic page.

    As you can see in this screenshot, wp_usermeta uses utf8_general_ci and on this screenshot you can see that values are correctly saved in fields. But on bbPress pages those utf8 characters are not displayed correctly. Also on profile editing page in bbPress, those characters are also nnot displayed correctly.

    Finally, on topic page, you can see that utf8 from usermeta is also not displayed correctly.

    Note that my registration is handled through WordPress since I redirect bbPress registration page to WordPress one, and on WordPress users fill their profile info, where everything is shown normally.

    Also to note that utf8 characters in topic titles and posts are displayed correctly.

    One strange thing I spotted is that if user edit it’s profile on bbPress profile editing page, and replace those question marks with correct characters, after that those characters would display normally on bbPress.

    So my question is why is this happening and how to solve it?

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)

  • Milan Dinić
    Participant

    @dimadin

    One more place where I found problem. I tried plugin Use Display Name and if there are utf8 characters in display_name values they are too displayed as question marks.

    I have the same problem, I solved it by filtering the display names:

    add_filter( 'get_user_display_name', 'rk_display_name' );
    function rk_display_name($name, $ID = 0) {
    if ( !seems_utf8( $name ) )
    return utf8_encode( $name );
    return $name;
    }

    Put this inside a plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar