/ftfy-web

Paste in some broken unicode text and FTFY will tell you how to fix it!

Primary LanguagePythonApache License 2.0Apache-2.0

ftfy-web

A simple web wrapper around Robyn Speer's FTFY Python library. Paste in some broken unicode text and it will tell you how to fix it!

Try it out at https://ftfy.now.sh/

The tool outputs Python code to fix the input text, for example:

s = "He's Justinâ\x9d¤"
s = s.encode('latin-1')
s = s.decode('utf-8')
print(s)

In some cases it will output additional imports from the ftfy package, for example:

import ftfy.bad_codecs  # enables sloppy- codecs
from ftfy.fixes import restore_byte_a0
s = 'It was named „scars´ stones“ after the rock-climbers who got hurt while climbing on it.'
s = s.encode('sloppy-windows-1250')
s = restore_byte_a0(s)
s = s.decode('utf-8')
print(s)