SexScripts : UTF-8 encoding (EMOJIS) not working on macOS Catalina - https://ss.deviatenow.com:443/viewtopic.php?f=6&t=929 | Page 1 of 1 |
UTF-8 encoding (EMOJIS) not working on macOS Catalina |
OneAndOnlyOdin [ Sat Nov 02, 2019 11:04 pm ] |
---|---|
UTF-8 encoded characters dont show up on the UI instead a square with a black border is shown as if the characters dont exist in whatever charset is the default. Either making UTF-8 the default charset or making it configurable from within a script would be good. Solving that bug would enrich script with emojis. |
Re: UTF-8 encoding (EMOJIS) not working on macOS Catalina |
doti [ Tue Nov 05, 2019 3:04 pm ] |
---|---|
Java uses UTF-16 (very like UTF-8) but limited (2 bytes only) encoding, accepting roughtly 32000 different characters, so it cannot represent all Unicode characters. Emojis are excluded, for example (being in a character set outside this 16 bits set). Summary : if the code is 4 digits long in hexadecimal (like 0x0041 or 0x20ac), it's ok without needing anything more. For other charaters, like emojis, we need a more complex solution. This code should show an emoji, but it depends on the character font : Code: show("Smiley : "+ String.format("%c", 0x1D11E))
|
Re: UTF-8 encoding (EMOJIS) not working on macOS Catalina |
OneAndOnlyOdin [ Wed Nov 06, 2019 9:59 pm ] |
---|---|
I see I didn't know that. Maybe I can convert the UTF8 encoded string coming from Odin's Master API to UTF16. I'll try this as soon as I have some time. |
Re: UTF-8 encoding (EMOJIS) not working on macOS Catalina |
OneAndOnlyOdin [ Sun Nov 24, 2019 11:03 pm ] |
---|---|
I finally found the time to try it out. Unfortunately I could not get it working.The 0x1D11E from your example does not seem to be a valid emoji as defined in https://unicode.org/emoji/charts/full-emoji-list.html and it renders a strange symbol I can't really make out what it is supposed to be. Also I tried converting the UTF8 from the API to UTF16 for Java https://github.com/OneAndOnlyOdin/VMast ... groovy#L28 The line Code: final features = ["insecure-html"] has to be changed to Code: final features = ["insecure-html", "emoji"] so the API sends emojis.But this too only shows empty squares for the emojis when I feed them into the getSelectedValue function and they don't show up at all if rendered as HTML in the result of a message. |
Page 1 of 1 | All times are UTC + 1 hour [ DST ] |