view bin/toutf8 @ 3509:6eb1b867a767

<oerjan> sed \'s/welcome/wercome/g\' bin/welcome > bin/wercome
author HackBot
date Wed, 28 Aug 2013 19:44:53 +0000
parents e037173e0012
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'))