Reputation: 237
I would like to add a unicode to the text of a SubmitField.
For instance, the code
submit = SubmitField('✉ Send')
does not work. How can I change that to show this envelope unicode?
Upvotes: 0
Views: 1044
Reputation: 1122372
Just use the unicode codepoint in a \uhhhh
escape sequence, there is no need to use HTML escapes:
submit = SubmitField('\u2709 Send')
or even the codepoint itself:
submit = SubmitField('✉ Send')
The string value produced is exactly the same.
The label is quoted to ensure proper handling in HTML, so any &
characters in the label value are encoded to &
, breaking your ✉
reference.
Upvotes: 1