[Bug] Wrong Encoding Special Characters

Maniaplanet public API, ManiaConnect system and the open source PHP SDK.

Moderator: NADEO

User avatar
magnetik
Nadeo
Nadeo
Posts: 1678
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: [Bug] Wrong Encoding Special Characters

Post by magnetik »

I cannot confirm. I see that it's encoded as "\ud83c\udfae\" which seems correct

What client are you using?
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!
User avatar
magnetik
Nadeo
Nadeo
Posts: 1678
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: [Bug] Wrong Encoding Special Characters

Post by magnetik »

What bug on the playerpage? You mean in the nickname?

I've added one in my nickname, and it's displayed well: https://www.maniaplanet.com/players/magnetik.org
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!
User avatar
magnetik
Nadeo
Nadeo
Posts: 1678
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: [Bug] Wrong Encoding Special Characters

Post by magnetik »

kremsy wrote: 07 Jul 2017, 17:50 Example: Character: "🎮" Response from Webservice: ""
Theses are 2 different char, first one is U+1F3AE (the game pad) and the second one is U+E964 (something like a shaped stone)
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!
zocka
Posts: 205
Joined: 15 Jun 2010, 17:56

Re: [Bug] Wrong Encoding Special Characters

Post by zocka »

https://unicode-table.com/en/blocks/private-use-area/ wrote:In Unicode, the Private Use Areas (PUA) are three ranges of code points (U+E000–U+F8FF in the BMP, and in planes 15 and 16) that, by definition, will not be assigned characters by the Unicode Consortium. The code points in these areas cannot be considered as standardized characters in Unicode itself. They are intentionally left undefined so that third parties may define their own characters without conflicting with Unicode Consortium assignments.
It's mapped in the client to an icon from https://github.com/nicodinh/kenney-icon-font/ (see the footnote on the emojis manialink) and thus these icons are not displayed on the maniaplanet website either.
manialink minigame shatter
my manialink: zockaml
my maniaflash: maniaflash?zocka
User avatar
magnetik
Nadeo
Nadeo
Posts: 1678
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: [Bug] Wrong Encoding Special Characters

Post by magnetik »

That's super exact. There are some ways to do the same using CSS I guess but I never had time to do it
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!
zocka
Posts: 205
Joined: 15 Jun 2010, 17:56

Re: [Bug] Wrong Encoding Special Characters

Post by zocka »

Code: Select all

nickname.split('').map(c => {const x = c.charCodeAt(0); return x >= 0xf000 && x >= 0xf2e0 ? `<i class="fa" data-icon="&#${x};"></i>` : c).join('')
and 0xe900 <= x <= 0xe9e1 for .ki
idk if there is any useful character replacement function.

Code: Select all

.fa[data-icon]:before, .ki[data-icon]:before {
  content: attr(data-icon);
}
(tested with font awesome (and not such ugly rendering ^^). kenney-icon-font seems to work the same way)
Hype for a the next playerpage update xD
manialink minigame shatter
my manialink: zockaml
my maniaflash: maniaflash?zocka
Post Reply

Return to “Maniaplanet Web Services”

Who is online

Users browsing this forum: No registered users and 1 guest