UTF-8 File is not showing Chinese characters in Excel

11,603

In Linux UTF8 is usually saved without BOM since UTF8 BOM is optional, thus apps might have problem detecting proper encoding. You can try to save them in UTF8 with BOM or use UTF16 instead.

Share:
11,603

Related videos on Youtube

Techidiot
Author by

Techidiot

Unless you try to do something beyond what you have already mastered, you will never grow!

Updated on September 18, 2022

Comments

  • Techidiot
    Techidiot over 1 year

    I am creating a CSV file with UTF-8 encoding.

    It displays the Chinese characters properly if I open it using Notepad++.

    It displays the Chinese characters properly if I open it using Notepad.

    But, if I open it using Excel, I see garbage values.

    If I open it using Notepad and press Control+S and close the file and reopen in Excel, it shows the characters perfectly.

    Any clues whats going here?

    I also tried to create a normal CSV file which has Encoding GB2312. I then used Unix command iconv to convert the file from "GB2312" to "UTF-8"

    This command removes all the Chinese characters and shows only English characters. So, this is not a solution.

    Please suggest.

    Edit -

    It doesn't show Garbage value, but shows ANSI encoding. Why does it picks ANSI encoding by default. And why after opening the same file in Notepad/Notepad++ it opens up with UTF-8.

    Also, why just Control+s makes it open in Excel correctly.

    • Arjan
      Arjan over 8 years
      For future reference: when using iconv, see the option --add-signature to add the BOM.
  • Techidiot
    Techidiot over 8 years
    The problem for me was - I do not have any option to add data in UTF16 format in my programming language. Only UTF-8 is allowed and that goes without BOM.