Home › forums › Using CanvasJS › Special characters in labels?
This topic contains 3 replies, has 2 voices, and was last updated by Indranil Deo 2 months, 3 weeks ago.
I’m trying to get a special character to show up in my label, but it doesn’t seem to like it.
This shows up the actual “ß” in the label (not what it should show – ie the entity itself). If I try and use actual utf8 in the label that shows up as a ? :
legendText: "\ß é",
If there a way to stop it encoding the label? (i.e actually translate the HTML entity, and don’t double encode it like ß)
You can achieve the above requirement by adding Unicode escape sequences in string literals. Please take a look at this jsfiddle.
Also, you can refer to this Wikipedia page for a list of Unicode.
Thanks for that. For some reason I was trying to use CSS values (hex), instead of escape sequences ;) I also found out the reason stuff like é was coming out corrupted. The issue was actually that the file was in ANSI and not UTF8 format. After converting the file, it works fine now.
Glad that it works :)
You must be logged in to reply to this topic.