Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account creation fails for user names with accented characters (Windows client) #5024

Closed
davidbolvansky opened this issue Nov 21, 2022 · 6 comments · Fixed by #5025
Closed

Comments

@davidbolvansky
Copy link
Contributor

davidbolvansky commented Nov 21, 2022

My username: Dávid Bolvanský

Boinc (Windows) runs following RPC:
https://live.fitcrack.cz/fitcrack/create_account.php?email_addr=testmaixxl%40gmail%2Ecom&passwd_hash=8736ae7117ec1f3710627f22697f6f8c&user_name=D%E1vid%20Bolvansk%FD

and it fails:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<br />
<b>Fatal error</b>:  Uncaught mysqli_sql_exception: Incorrect string value: '\xE1vid B...' for column 'name' at row 1 in /home/boincadm/projects/fitcrack/html/inc/db_conn.inc:69
Stack trace:
#0 /home/boincadm/projects/fitcrack/html/inc/db_conn.inc(69): mysqli-&gt;query()
#1 /home/boincadm/projects/fitcrack/html/inc/db_conn.inc(184): DbConn-&gt;do_query()
#2 /home/boincadm/projects/fitcrack/html/inc/boinc_db.inc(223): DbConn-&gt;insert()
#3 /home/boincadm/projects/fitcrack/html/inc/user_util.inc(126): BoincUser::insert()
#4 /home/boincadm/projects/fitcrack/html/user/create_account.php(134): make_user()
#5 {main}
  thrown in <b>/home/boincadm/projects/fitcrack/html/inc/db_conn.inc</b> on line <b>69</b><br />

Looks like 'Dávid Bolvanský' is in ISO-8599-1 and then urlencoded. If in utf8 and then urlencoded, 'D%C3%A1vid%20Bolvansk%C3%BD' works fine.

ai->user_name = (const char*)::wxGetUserName().mb_str();

utf8_str ?

@davidbolvansky davidbolvansky changed the title Account creation fails for user names with accented characters Account creation fails for user names with accented characters (Windows client) Nov 22, 2022
@AenBleidd
Copy link
Member

Possible duplicate of #1503

@davidbolvansky
Copy link
Contributor Author

I dont think so, as there is no xml here, just simple url request.

@AenBleidd
Copy link
Member

Looks like both issues are related to database encoding that doesn't support UTF-8.
@davidpanderson, could you please take a look?

@davidbolvansky
Copy link
Contributor Author

I have a working fix
#5025

@davidpanderson
Copy link
Contributor

The MySQL default charset should be utf8mb4
We don't mention this in the docs.
E.g.:
MariaDB [test]> select @@character_set_database;
*************************** 1. row ***************************
@@character_set_database: utf8mb4
1 row in set (0.00 sec)

MariaDB [test]> select @@collation_database;
*************************** 1. row ***************************
@@collation_database: utf8mb4_unicode_ci

@davidbolvansky
Copy link
Contributor Author

The MySQL default charset should be utf8mb4

Yeah, finally since MySQL 8.

@AenBleidd AenBleidd added this to the Client 7.22.0 milestone Nov 23, 2022
@AenBleidd AenBleidd linked a pull request Nov 23, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants