Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting standard looking characters to strange/crazy looking UTF-8 characters?

Tags:

utf-8

The inspiration for this question comes from this SO answer: https://stackoverflow.com/a/1732454/11125

I want to write a script to convert standard looking characters (e.g. letters in the English alphabet), to UTF-8 characters that are unusual and makes me appear crazy.

Did kiamlaluno sift through the thousands of UTF-8 characters to find similar looking characters to English letters, or is there possibly a more automated way to do this?

I would like the answer in Python, but any programming language will probably give me a suitable solution.

For example, convert:

PONY

to

P̯͍̭O̚​N̐Y̡

A decent excerpt from the SO answer:

.

co*̶͑̾̾​̅ͫ͏̙̤g͇̫͛͆̾ͫ̑͆l͖͉̗̩̳̟̍ͫͥͨe̠̅sZA̡͊͠͝LGΌ ISͮ̂҉̯͈͕̹̘̱ TO͇̹̺ͅƝ̴ȳ̳ TH̘Ë͖́̉ ͠P̯͍̭O̚​N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ?

like image 725
gak Avatar asked Apr 17 '13 04:04

gak


1 Answers

There's a python module called pyzalgo.

>>> import zalgo
>>> print zalgo.zalgo('hello')
Ḩ̝̳͓̪̲͌̌͗̔́͌̄͢͢͢͢͢͢E̶̢̯̭̟̥̖̯̙̬ͪ̄̉ͭ͗̏́̈́L̢̢͓̺͇̠̠͉͙̪͍̽ͣͩ͂̾͒̊ͦL̵̶̶̢̬͈̬̦̜̥̲̜͓͎̝̣̙̞̝Ơ̷̸̴̷̘͙͕͈̞̜̠͙̰̬̰̣̟̭

It appears to be pretty straightforward and customisable after a quick look at the code.

Thanks for the info @hobbs.

like image 56
gak Avatar answered Oct 12 '22 10:10

gak