Jump to content

[Frage/Hilfe] Metin2 von latin1 windows1252 umprogrammieren auf UTF-8


Recommended Posts

Good day

I have a question, does anyone know how to reprogram the encoding from windows1252, latin1 to UTF-8 in the client?

I have set table account to UTF-8 (utf8mb4, utf8mb4_unicode_ci) on the MySQL server.

When I log into the client, I would like to use umlauts or other languages for the login data, e.g. (ÖÄÜ 정 추가.اختبار)

I know that the client can only work with windows1252, latin1, so you have to change something in the src c++ client I hope you could help me with this problem, thank you

 

 

 

Gutan Tag

Ich habe mal ne frage weist jemand wie man im Client die Codierung von windows1252, latin1 auf UTF-8 umprogrammieren kann?

 

Ich habe auf dem MySQL Server Tabelle Account auf UTF-8 (utf8mb4, utf8mb4_unicode_ci) eingestellt.

Wenn ich mich in den Client einloge, möchte ich gerne bei den Logindaten umlaute sonderzeichen oder andere sprachen benutzen z.b (ÖÄÜ 정 추가.اختبار)

ich weis das der client nur windows1252, latin1 umgehen kann da muss man bestimmt irgendwas im src c++ Client ändern

ich hoffe ihr konnt mir bei diesen problem helfen danke

2ax6bab.png

M1Yqgab.png

Edited by Metin2 Dev
Core X - External 2 Internal

fun

Link to comment
Share on other sites

  • Management
  • Premium

Can you clarify your goal a little bit? So first of all you must know that by default the client will only be able to display characters from the selected codepage (and ofc these characters must be present in the font aswell). What it means that the client will always threat 1 byte of string as a single representable character, while a unicode codepoint can take up to 4 bytes of string (in utf8).

If you just want to be able to login even tho its not displayed correctly, you can just use for example boost locale (boost::locale::conv::to_utf) with the codepage used on the string, to get a valid unicode string, and then send it to the server for comparison (note that you might have to do normalization on the string to make sure its in the same normalization form as the saved text in the database (in this case probably NFD would be a better choice because we want an exact match of codepoints used and not the physical result of the composed character)). This can be done with utf8proc for example.

If you want to display characters correctly aswell, then you will have to completely rework the TextLine class and use sophisticated typography processors like uniscribe or directwrite(dx10+) or harfbuzz+fribidi+freetype.

Edited by masodikbela
  • Good 1

The one and only UI programming guideline

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.