Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Can Roll20 handle any UTF-8 characters? What character sets should be avoided? Also bogus characters appearing randomly.

1579141225

Edited 1579141545
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
As a sheet author, I got a private bug report from somebody who used my "Earthdawn by FASA" sheet.  I use extended UTF-8 characters as a prefix to abilities so that the Token Actions group up such that all weapons are grouped together, etc.  I use the following characters.  Earthdawn.Constants = { CommaReplace: "Ñ", // Character Ñ Character name LATIN CAPITAL LETTER N WITH Tildi Hex code point 00D1 Decimal code point 219 Hex UTF-8 bytes C3 91 ColonReplace: "Ò", // Buttons don't like colons, so anytime we want one in a button, replace it for a while with this. Character Ò Character name LATIN CAPITAL LETTER O WITH GRAVE Hex code point 00D2 Decimal code point 210 Hex UTF-8 bytes C3 92 SymbolTalent: "ı", // small i dotless: &# 305; SymbolKnack: "ķ", // K with cedilla: &# 311; SymbolSkill: "ş", // S with cedilla: &# 351; SymbolWeapon: "⚔", // Crossed swords: &# 9876; SymbolSpell: "⚡​", // Lightning Bolt or High Voltage: &# 9889; SymbolTarget: "➴​" }; // Heavy Black-Feathered South East Arrow: &# 10167; Used as a grouping with a high number, to be ordered last. Both of the Macro's that are also Token Actions that start with SymbolTarget instead of having the arrow pointing down and right, had three question marks.  In addition, (and this might be a separate problem), Another Macro / Token Action that does not have any weird characters whatsoever is also showing as starting with three question marks.  When I just paste my API code that creates these macros into a custom API script, it always works fine.  But when I add the script from the script library, it always has the three question marks.  When I look at the code in the Roll20 github repository, everything looks fine (I see the special symbols, nothing is in front of the other macro name).  But when I import the script from the script library, I see that "Attrib" now starts with a red symbol that is nether in my text editor, nor visible in the roll20 github repository.  The Arrows however still seem fine in the imported version.  So my code seems to behave differently depending upon what route it takes to get to campaign.  Copied from my text editor directly to Roll20 API.   Fine. Uploaded to github, merged into the script library and imported.   Extra characters show up when looking at the imported code, but it seems to work more or less OK.  Uploaded to github, merged into the script library and added.   All the non-plain vanilla characters turn into ether 3 or 5 question marks.  Any ideas as to what is going on and what I can do to fix it? I am thinking of maybe instead of trying to store the value as a literal, maybe make these a function that returns a result from .fromCharCode()? So I have an idea for one way to fix it, but would like an idea of what people think is going on and why it is happening, and what might be the most appropriate fix.  Thanks.
1579171032

Edited 1579171124
GiGs
Pro
Sheet Author
API Scripter
There've definitely been issues with character encoding before when going from one-click install, so it does seem like there's some incompatibility there in the automated install chain. It's all inaccessible to us, so it's hard to say the specific cause. I wouldnt be surprised if extended UTF-8 characters also have issues, but as you say, it might not be the exact same one. Since that SymbolTarget is only happening with the one symbol, can you find another target-like symbol to replace it with that works?  The fromCharCode method is probably the best way though. I like the idea of using symbols to group macros and token actions. I'll have to try that myself.