Re:When a Space Is Not a Space
by dspillett on Thursday June 17, 2021 @08:19AM
(#27538791)
It isn't just the usual non-breaking space. I've seen other space types like "En Space" creep into content copied into HTML entry forms, and cause issues further down the line (usually a ? appearing when an app tries to convert to a non-unicode encoding and doesn't understand these characters).
If you want to be evil to a programmer, as well as being tricksy with white-space, replace some semi colon characters (U+003B - ;) with Greek question marks (U+037E - ;) and see ho wlong it takes them to work out why their compiler or linter isn't happy…
The takeaway from all this is that you should never assume plain text is simple.
Re:When a Space Is Not a Space
by macNchz on Thursday June 17, 2021 @09:28AM
(#27539336)
Yeah I’ve encountered some really fun bugs on more than one occasion due to zero-width spaces sneaking into places they shouldn’t be. I hate Word documents as a medium for sending around API instructions or content for a CMS for this reason.
There are a few spaces in the Unicode standard: https://www.compart.com/en/unicode/category/Zs
And the list linked above doesn't include things like zero-width-joiner. See https://en.wikipedia.org/wiki/Whitespace_character for a fuller list.
If you want to be evil to a programmer, as well as being tricksy with white-space, replace some semi colon characters (U+003B - ;) with Greek question marks (U+037E - ;) and see ho wlong it takes them to work out why their compiler or linter isn't happy…
The takeaway from all this is that you should never assume plain text is simple.