Update __init__.py

when processing a text with invalid encoding, shorten function will crash. (sorry for english)

UnicodeDecodeError: 'ascii' codec can't decode byte 0xb1 in position 0: ordinal not in range(128)