diff bin/toutf8 @ 122:d7dad74b8909

<elliott> run rm bin; mv test bin
author HackBot
date Thu, 22 Mar 2012 19:17:56 +0000
parents e037173e0012
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/toutf8	Thu Mar 22 19:17:56 2012 +0000
@@ -0,0 +1,6 @@
+#!/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'))
\ No newline at end of file