Guild API strings are UTF-8 encoded twice?

Guild API strings are UTF-8 encoded twice?

in API Development

Posted by: Averdia.9753

Averdia.9753

The GW2 guild API seems to be doing a UTF-8 encoding twice on strings which means they don’t get decoded correctly on the client end unless you do a workaround. I’ve not checked the other APIs.

An example is the guild “Bojovní Lumíci”. The API returns “Bojovn?? Lum??ci” which is 0xEF 0xBF 0×83 0xEF 0xBE 0xAD for the out of place characters. The forum is stripping out those characters and replacing it with ?? so you’ll have to look at the JSON output of the API for the actual characters. If you run each 3 byte encoding through the UTF-8 decoding algorithm and ignoring the invalid codepoints then you get 0xFF 0xC3 0xFF 0xAD. If you then strip out the extraneous 0xFFs then you’re left with 0xC3 0xAD which is the UTF-8 encoding for í.

https://api.guildwars2.com/v1/guild_details.json?guild_id=95EE4085-7824-4564-AC3F-77F79C970D7C

Apologies for anybody actually in Bojovní Lumíci. You’re just a handy example due to the accented letters in your name.

Guild API strings are UTF-8 encoded twice?

in API Development

Posted by: smiley.1438

smiley.1438

Yeah, seems like there’s something wrong with the encoding on API side, probably happened during the backend change a couple days ago. API v1 only.

See also: http://wiki-de.guildwars2.com/wiki/Widget:Karte#Beispiel (floor data)

(edited by smiley.1438)

Guild API strings are UTF-8 encoded twice?

in API Development

Posted by: fooey.5824

fooey.5824

Whew, I thought I’d broken something on my side

Guild API strings are UTF-8 encoded twice?

in API Development

Posted by: Lawton Campbell

Lawton Campbell

Web Programmer

Next

Tracked this one down today, hoping to have the fix deployed sometime this week. Thanks for the report!

Guild API strings are UTF-8 encoded twice?

in API Development

Posted by: AysonCurrax.3254

AysonCurrax.3254

Tracked this one down today, hoping to have the fix deployed sometime this week. Thanks for the report!

by “this one” do you mean the encoding issue in general, or just for the guild api? the v1/skin_details.json is affected by that issue as well, as i mentioned on the recent maintenance post. the v1/recipe_details.json and v1/item_details.json might be affected by the same issue. I would appreciate if you were to look into that, if you havent already.

Guild API strings are UTF-8 encoded twice?

in API Development

Posted by: Pat Cavit.9234

Previous

Pat Cavit.9234

Web Programming Lead

Next

The fix for all of these issues is identical.

Guild API strings are UTF-8 encoded twice?

in API Development

Posted by: Lawton Campbell

Previous

Lawton Campbell

Web Programmer

And the fix is live.

Guild API strings are UTF-8 encoded twice?

in API Development

Posted by: AysonCurrax.3254

AysonCurrax.3254

And the fix is live.

Thanks A Lot! Now that also explains why my request timed out earlier too.