Last active
August 29, 2015 14:16
-
-
Save ryonsherman/2bb6b2de1ac3e4a75cde to your computer and use it in GitHub Desktop.
Output text containing random Combining Diacritical Marks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import sys | |
import random | |
text = ' '.join(sys.argv[1:]) | |
if not text: | |
sys.exit("usage: %s <text>" % sys.argv[0]) | |
output = [] | |
for char in text: | |
char = unicode(char) | |
if char.isspace(): | |
output.append(char) | |
continue | |
for i in range(random.randint(2, 5)): | |
mark = random.randint(int('0300', 16), int('036F', 16)) | |
char += unichr(mark + 1) | |
output.append(char) | |
print ''.join(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unicode Specificion
Example: