Mastodon Feed: Post

Mastodon Feed

Reblogged by jwz:

simontatham@hachyderm.io ("Simon Tatham") wrote:

In the old #ASCII days, you could change a letter between upper and lower case by XORing its character code with 0x20. Of course, if you tried this with anything that wasn't a letter, you'd get nonsense results.

If you try that with #Unicode code points, it sometimes works, and sometimes doesn't. But Unicode can deliver much more impressive nonsense when it doesn't.

A fun example I just found: the "lower-case" version of CAR is NO PEDESTRIANS.

>>> chr(ord('🚗') ^ 0x20)
'🚷'