Encoding.GetEncoding(1252) C# FR letters — Guild Wars 2 Forums

Encoding.GetEncoding(1252) C# FR letters

Okey some guys have nickname as :"Magè" and when i parse https://api.guildwars2.com/v2/characters?access_token= i got wrong symbols, any solution?

Comments

  • Api should be UTF-8 iirc

  • Same as ISO-8859-1 and windows-1252 shoud it works as charracter id?
    https://c.radikal.ru/c24/1908/5c/4f18095580c5.jpg

  • Zok.4956Zok.4956 Member ✭✭✭

    @Morozzko.2136 said:
    Same as ISO-8859-1 and windows-1252 shoud it works as charracter id?

    @Morozzko.2136 said:
    Okey some guys have nickname as :"Magè" and when i parse https://api.guildwars2.com/v2/characters?access_token= i got wrong symbols, any solution?

    Your API-client should treat all data from the API, this includes the character names, as UTF-8 encoded. If you use internally a different character encoding in your client you have to convert the data from UTF-8 to i.e. ISO-8859-1 etc. but then you have to convert it back to UTF-8 when you use the character name for the endpoint: "v2/characters/:id/"

    But be aware: There are UTF-8 characters that have no corresponding character in ISO-8859-1 and other single byte encodings. These would be lost if you convert to ISO-8859-1.

    So the best solution (if possible for your app) would be to use only UTF-8 character encoding in your app/client.

    https://www.gw2gh.com/ - A GW2-Guild-Hall.
    Register and check your guild leaderboard to see who is the best in your guild and who finished achievements first.