• Resolved Aaron

    (@aaron13100)


    A user logged in to my website using Google and their name is all kanji characters, e.g. 幹事. The plugin created the a user_login for them which is “Google_” with no characters after the google prefix.

    1) It would be nice to retain the characters even if they’re not english characters.

    2) Will this cause an issue the next time someone with only kanji characters creates an account? They’ll have the same user_login, right?

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Laszlo

    (@laszloszalvak)

    Hi @aaron13100

    What you need to know is that, by default we try to generate usernames from the name that comes from the provider.
    If the name contains special characters then we won’t be able to generate a valid username since WordPress doesn’t support special characters in usernames.
    Normally in this case, we generate a unique and random username for the user. In your case this doesn’t happen, because you probably used the “Username prefix on register” setting of the given provider.

    In such cases this is what Nextend Social Login does:

    1. we sanitize the given username. Since it contains special characters the sanitized username will be empty.
    2. we add the specified prefix before the sanitized username, so if your prefix is “Google_” then we will try to register the account with the username “Google_”
    3. If an account with such username already exists, then we will append a number after the username. E.g. If an account already exists with the username “Google_” then we will try “Google_1” if that already exists as well, then we will increase the number by 1 ( so it will be Google_2 ) and we will check if that username is free or not. We will continue doing this until we find a username that is free and we will register the account with that username.

    So don’t worry, this way each account will always have a unique userID, even if we can not generate a username from the given name.

    Note:
    We also try to store the first name and last name. There you will find the name with the kanji characters, since WordPress allows the special characters there.

    Thread Starter Aaron

    (@aaron13100)

    Great thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Non-english characters are lost’ is closed to new replies.