Created
February 24, 2014 19:30
-
-
Save etrepum/9195248 to your computer and use it in GitHub Desktop.
UTF-16 w/ BOM tab delimited CSV in Excel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> open('chinese.csv', 'w').write(u'English\tChinese\r\nChinese\t汉语\r\n'.encode('utf-16')) | |
>>> open('chinese.csv', 'r').read() | |
'\xff\xfeE\x00n\x00g\x00l\x00i\x00s\x00h\x00\t\x00C\x00h\x00i\x00n\x00e\x00s\x00e\x00\r\x00\n\x00C\x00h\x00i\x00n\x00e\x00s\x00e\x00\t\x00Il\xed\x8b\r\x00\n\x00' | |
>>> os.system("open -a 'Microsoft Excel' chinese.csv") |
Author
etrepum
commented
Feb 24, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment