I want to draw special ASCII symbols on my HTML5 canvas i.e. £ but they actually show up as the letters themselves rather than a pound symbol. What can I do to make these show up correctly?
£ is a HTML entity, it doesn't mean anything apart in XML/SGML based markup languages.
But you don't need it as Javascript lets you manage Unicode. Simply use the literal
var pound = '£';
and be sure to save and serve your javascript files as UTF-8.
Or if you can't use UTF-8, escape it as
var pound = "\u00A3";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With