https://github.com/simonw/ftfy-web
Paste in some broken unicode text and FTFY will tell you how to fix it!
https://github.com/simonw/ftfy-web
python sanic unicode
Last synced: 6 months ago
JSON representation
Paste in some broken unicode text and FTFY will tell you how to fix it!
- Host: GitHub
- URL: https://github.com/simonw/ftfy-web
- Owner: simonw
- License: apache-2.0
- Created: 2018-01-09T03:00:43.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-14T21:41:45.000Z (over 2 years ago)
- Last Synced: 2024-10-18T07:54:20.305Z (12 months ago)
- Topics: python, sanic, unicode
- Language: Python
- Homepage: https://ftfy.now.sh/
- Size: 14.6 KB
- Stars: 67
- Watchers: 7
- Forks: 8
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ftfy-web
A simple web wrapper around [Robyn Speer](https://twitter.com/r_speer)'s [FTFY Python library](https://github.com/LuminosoInsight/python-ftfy). 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)