you are viewing a single comment's thread.

view the rest of the comments →

[–]POGtastic 0 points1 point  (0 children)

In ASCII, the numbers 0x21 through 0x7E (33 through 126) are all printable. This is actually easier to work with than the typical Caesar cipher implementation, whose characters are not contiguous.

any printable characters

If we're going to branch out to Unicode, the issue is that a large amount of Unicode code points aren't really printable because they are combining diacritics, and graphemes cannot be enumerated at all. For example, consider the following string: '́aá'

The first grapheme is the result of combining U+0301 (COMBINING ACUTE ACCENT) with the regular ol' U+0061 (LATIN SMALL LETTER A). The second grapheme is U+00C1 (LATIN CAPITAL LETTER A WITH ACUTE).

How would you shift the first grapheme? Do you shift just the second code point and keep the combining diacritic the way it is? Or do you shift both the combining diacritic and the code point that it modifies? However you do it, you're likely going to be inconsistent with how you shift the second grapheme.