Results 1 to 7 of 7

Thread: [RESOLVED] CSV File Format: UTF8 vs ANSI vs UTF16 w/o BOM

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Resolved [RESOLVED] CSV File Format: UTF8 vs ANSI vs UTF16 w/o BOM

    I wrote an ExportToCSV function to export Grid content to CSV format. For better Unicode support, the CSV file can be save in UTF8 or UTF16 (L or B) or UTF7 (not so good, Chrome even not support UTF7) or UTF32(L or B). My question is:

    1. Does it break the CSV Format standard? My answer is yes, native CSV is ANSI w/o BOM.

    2. Should I put BOM?

    I did some experimental in Excel. All have BOM signature.

    a. UTF32BE: Excel Can load and has CSV format but got a question mark at the front of the first row from BOM signature.
    b. UTF32LE: Excel lost csv format, but can load.
    c. UTF16BE: Excel Can load and has CSV format but got a question mark at the front of the first row from BOM signature.
    d. UTF16LE: Excel lost csv format, but can load.
    e. UTF8 : OK
    f. UTF7 : Excel Can load and has CSV format but got "+/v8" mark at the front of the first row from BOM signature.

    So, with BOM, UTF8 got the best support for MS Excel and Ms NotePad and it is my best choice. But for some software with poor or less unicode or BOM consideration, they may get problem to parse. I got into a dilemma.

    Refer to attachment for summary.
    Attached Images Attached Images   
    Last edited by Jonney; Sep 4th, 2015 at 04:30 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width