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

Courtier 'Dorylus' turns into Courtier%20%27Dorylus%27 in name

Hi, I have  Courtier 'Dorylus' in gmnotes field I copy it to name field o.set('name',o.get('gmnotes')); and I get  Courtier%20%27Dorylus%27 in the name field and nameplate what special care do I need to have to prevent this from happening?
1445951568
The Aaron
Pro
API Scripter
That is an encoding imposed by your browser when the text is entered into the text box.  You should be able to fix it (and restore the original encoding) like this: o.set( 'name', o.get('gmnotes') .replace( /%([0-9A-Fa-f]{1,2})/g, function(f,n){ return String.fromCharCode(parseInt(n,16)); } ) );
You're a wizard :) It works ^_^ 
We should add this to the wiki somewhere (couldn't find a mention)
1445976565
The Aaron
Pro
API Scripter
Definitely a good idea.  I'll see if I can do that at some point. =D
1446024001

Edited 1446026677
WurmD
KS Backer
I'm willing to do it, I am just unsure where , or where to link it started here:&nbsp;<a href="https://wiki.roll20.net/Encoding" rel="nofollow">https://wiki.roll20.net/Encoding</a>
1446057276
The Aaron
Pro
API Scripter
That's a nice start! &nbsp;I went ahead and wrote documentation here: &nbsp; <a href="https://wiki.roll20.net/API:Cookbook#Handling_Enco" rel="nofollow">https://wiki.roll20.net/API:Cookbook#Handling_Enco</a>... I started with your text, but it's pretty much unrecognizable now. =D
;) it's all good better than good really, since my start countered any blank page effects ^_^
1446128290
The Aaron
Pro
API Scripter
=D