Using rotunicode

I'll write it for a memorandum someday when I use it.

A Python library named rotunicode is released from the box.

https://github.com/box/rotunicode

This is a library that converts the ASCII string of latin-1 into a Unicode string similar to an ASCII string.

By registering in codec like this, you can specify it with encode function.

import codecs
from box.util.rotunicode import RotUnicode

codecs.register(RotUnicode.search_function)

print('Testing rotunicode'.encode('rotunicode'))
>>> Ƭȅŝƭȉńġ ŕőƭȕńȉćőďȅ
print('Ƭȅŝƭȉńġ ŕőƭȕńȉćőďȅ'.decode('rotunicode'))
>>> Testing rotunicode

What do you use?

It is easy to test whether Unicode works properly.

import os, errno

name = 'foo'.encode('rotunicode')
os.mkdir(name)

print(name)
>>> ƒőő

At this time, if you use a Japanese character string such as "AIUEOO", it may seem that from an English speaker it seems like "I do not want to use such a character that I have never seen before".

However, using this rotunicodee will result in a Unicode string similar to the original ASCII string. Therefore, we can expect even though the effect that it may think that "that, this may be used somewhere ...". maybe…