view bin/toutf8 @ 0:e037173e0012

Initial import.
author HackBot
date Thu, 16 Feb 2012 19:42:32 +0000
parents
children
line wrap: on
line source

#!/usr/bin/python
import sys
import chardet
x = sys.stdin.read()
enc = chardet.detect(x)['encoding']
sys.stdout.write(x.decode(enc).encode('UTF-8'))