NOTE: Works for Elm 0.19.
If you attempt to display the copyright symbol using the following:
view = text "©"
Then you'd literally see ©
.
In order to get © you need to use Unicode escape characters.
view = text "\u{00A9}"
It's that simple.
If for any reason you mess up the escaping syntax (maybe you forget the curly braces, like a "friend" of mine did ;)) then Elm has your back with this insanely helpful error message.
BTW, you can lookup the hex codes for what you need here.
P.S. I needed to figure this out when I had to output a non-breaking space in my Drum Machine project.
Top comments (3)
Thanks for the article!!! I had no idea you could do this in Elm
You're welcome.
Good stuff! It's little stuff like this that can easily turn into a source of fustration.