Lol, just realized my table should be "EURO_SIGN=b'\xe2\x82\xac'.decode('utf8')".
Damn, a perfect example of why it's nice to be able to just do "€" in my file. It's also less bugs.
Damn, a perfect example of why it's nice to be able to just do "€" in my file. It's also less bugs.
EURO_SIGN = '\N{EURO SIGN}'
Which is ASCII, and very clear about which character the escape is. I wish more languages had \N. That said, I'm also fine with a coder choosing to write a literal "€" — that's just as clear, to me.While I don't believe the \N is backwards compatible to Python 2, explicitly declaring the file encoding is, and you can have a UTF-8 encoded source file w/ Python 2 in that way.
I'd also note the box drawing characters are extremely useful for diagrams in comments.
(And… it's 2021. If someone's tooling can't handle UTF-8, it's time for them to get with the program, not for us to waste time catering to them. There's enough real work to be done as it is…)