Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- # http://cuio.blog2.fc2.com/blog-entry-2165.html
- import codecs
- fpath = '/Users/kmiura/20140523.txt'
- newfpath = fpath + 'updated.txt'
- f = codecs.open(fpath, encoding='utf-8')
- s = f.read()
- t = dict((0x0020 + ch, 0xff00 + ch) for ch in range(0x5f))
- t[0x0020] = 0x3000
- print s.translate(t)
- nf = codecs.open(newfpath, encoding='utf-8', mode='w')
- nf.write(s.translate(t))
- nf.close()
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement