Skip to content

Instantly share code, notes, and snippets.

@dannguyen
Last active October 25, 2019 19:18
Show Gist options
  • Save dannguyen/13d5c39d499e4bbec622e055283fbb19 to your computer and use it in GitHub Desktop.
Save dannguyen/13d5c39d499e4bbec622e055283fbb19 to your computer and use it in GitHub Desktop.
ni hao world (testing unicode in Excel)

Does Excel correctly open utf8-encoded CSV files?

(using Office for Mac 16.16.15)

printf "hello,world\nNǐ hǎo,shìjiè\n你好,世界\n" > nihao.csv
# or:
# curl -o nihao.csv https://gist.githubusercontent.com/dannguyen/13d5c39d499e4bbec622e055283fbb19/raw/f1c50ced36033b9a3aed36ebbbf0cf8734a98809/nihao.csv
  
open -a 'Microsoft Excel' nihao.csv

Result:

hello	world
Nǐ hǎo	shìjiè
你好	世界

image

Related: https://superuser.com/questions/280603/how-to-set-character-encoding-when-opening-excel

hello world
Nǐ hǎo shìjiè
你好 世界
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment