Mercurial > repos > simon-guest > unicode_tester
comparison print_unicode.py @ 0:e8df78caf3f3 default tip
Initial public version
| author | Simon Guest <simon.guest@agresearch.co.nz> |
|---|---|
| date | Wed, 25 Sep 2013 11:14:00 +1200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:e8df78caf3f3 |
|---|---|
| 1 #!/usr/bin/env python | |
| 2 # | |
| 3 # Output unicode on each file given as an argument. | |
| 4 # | |
| 5 # Initial version: Simon Guest, 20/9/2013 | |
| 6 | |
| 7 import sys | |
| 8 | |
| 9 def utf8ify(s): | |
| 10 return s.encode("UTF-8") | |
| 11 | |
| 12 i = 0 | |
| 13 for x in sys.argv[1:]: | |
| 14 i += 1 | |
| 15 f = open(x, 'wb') | |
| 16 f.write(utf8ify(x + " unicode " + unichr(233 + i) + unichr(0x0bf2 + i) + unichr(3972 + i) + unichr(6000 + i) + unichr(13231 + i) + "\n")) | |
| 17 f.close() |
