• Anonymous User 439586

    (@anonymized-439586)


    Chat in general works fine, even text with umlauts is ok. But if the Username contains umlauts, there are wrong encoded:
    User “Müller” is displayed as “M??ller”

    Looks like a classic utf8-encoding-problem ??

    https://www.ads-software.com/plugins/chat/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi Karsten,

    I hope you are well today and thanks for posting on the forum.

    By default in the WordPress admin area when we try to create a user in WordPress having username as Müller then it displays the following error message resulting in not allowing to create users with such user names.

    This username is invalid because it uses illegal characters. Please enter a valid username.

    Please advise.

    Kind Regards,
    Vinod Dalvi

    Thread Starter Anonymous User 439586

    (@anonymized-439586)

    Hello Vinod,
    Thanks for coming back and sorry for confusing.

    It’s not the username, but the display-name you use in the plugin.
    I uploaded two Images from our testinstallation, I hope they will clarify the issue.

    User in WP Backend: https://abload.de/img/chat-1lzu3w.jpg
    User in Frontend-Chat: https://abload.de/img/chat-215uyp.jpg

    Thanks for helping.

    Kind regards,
    Karsten

    Thread Starter Anonymous User 439586

    (@anonymized-439586)

    Steps to reproduce:
    – Check: <?php bloginfo(‘charset’); ?> is “UTF-8”
    – Add a WordPress-user with a username of your choice (without umlauts).
    – Set the lastname of this user to something with an Umlaut (like “Müller”)
    – Set the nickname to something containing the lastname
    – Login as this user, post something in the chat.
    – Displayed Username will not be “Müller”, but “M??ller”.

    (WordPress 4.1, Theme Twenty Fourteen, in case it matters)

    Hi @karsten,

    Thanks so much for those extra details! I was able to replicate it and for a quick fix you can do the following:

    In wp-content/plugins/chat/ you’ll see chat.php

    Line 2225 reads like so:

    $prepend .= ' <span class="name" style="background: ' . $name_color . ';">' . stripslashes( $row->name ) . '</span>';

    You can replace that with this:

    $prepend .= ' <span class="name" style="background: ' . $name_color . ';">' . stripslashes( html_entity_decode($row->name) ) . '</span>';

    It’s basically just adding the html_entity_decode() function which needs to be there since the name is initially encoded with that.

    Meanwhile, I’ll get this over to the developers right away!

    Thanks!
    David

    Thread Starter Anonymous User 439586

    (@anonymized-439586)

    Hi David,

    thank you very much, works for me!

    Kind regards,
    Karsten

    Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    You are most welcome here, if we can be of any further assistance please don’t hesitate to ask ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Username with Umlatus: wrong encoding’ is closed to new replies.