AttorneyOnline / AO2-Client

An off-the-cuff courtroom drama simulator
https://aceattorneyonline.com
GNU General Public License v3.0
61 stars 58 forks source link

[BUG] Unicode symbols are not properly saved/restored from config.ini #1014

Closed Salanto closed 4 months ago

Salanto commented 4 months ago

Apparently people put unicode symbols into their usernames in client and since the config rewrite it does not appear to work correctly.

lambdcalculus commented 4 months ago

Which symbols are causing trouble exactly? Tried some funky characters (including emoji) and they seemed to be working (on Linux, if that matters somehow).

Salanto commented 4 months ago

Before saving/loading image After image

They are last I checked on Windows 10

lambdcalculus commented 4 months ago

What is actually saved in the config.ini? Just "Magy"?

TrickyLeifa commented 4 months ago

This isn't a problem in the current yet-to-be-released version. Or if it isn't, we don't have the proper symbol propagating this issue.

in1tiate commented 4 months ago

For future reference, this was indirectly fixed by the move from Qt5 to Qt6. Qt6 assumes UTF-8 encoding, whereas Qt5 defaults to the value of QTextCodec::codecForLocale(), which as the name suggests can vary based on locale.

In Qt 5 based applications, this can be circumvented by explicitly setting the codec to UTF-8:

QFile myfile;
myfile.setCodec("UTF-8");