keep encoding in export

nobswolf's profile image nobswolf posted 8 years ago in Feature discussion Permalink

The dialog for exporting a result offers the encoding, but it always defaults to ANSI. I guess most users need always the same encoding. So it would be nice if Heidi keeps the selection in the settings.

And it would be nice to have an "UTF8 with BOM" which makes it easier to open it in Excel.

And while I am at it: A warning if the first column is named "ID" would be nice, because this can lead to strange results in Excel.

ansgar's profile image ansgar posted 8 years ago Permalink

Excel expects ANSI, not UTF8 with BOM. That's why the default for the "Excel CSV" option is ANSI. Try it out, and export some german umlauts (äöü) or something into such a CSV file and import that in Excel.

What does an "ID" column do in Excel?

nobswolf's profile image nobswolf posted 8 years ago Permalink

Ok, let me rephrase: If you need UTF-8 it should be with BOM for Excel :) I have multilingual databases, including chinese... so no chance to do this in ANSI. My current workflow is:

  1. choose Excel CSV
  2. switch to UTF-8
  3. load in Notepad++
  4. convert to UTF-8 with BOM
  5. import in Excel

If the first column in an CSV is named ID the import defaults to some old DB-format, I'll try tomorrow when I have an Excel at hand.

nobswolf's profile image nobswolf posted 8 years ago Permalink

Ok, forget about the ID. This only happens when it is not quoted. So this is not an issue with Heidi.

I attached a test.csv in UTF-8 with BOM which loads nicely into Excel. Without the BOM it defaults to ANSI which is wrong in this case.

So an option "UTF-8 with BOM" would make possible to export Unicode CSV which is directly import-able by Excel.

1 attachment(s):
sasho's profile image sasho posted 7 years ago Permalink

Hi nobswolf,

I'm having exactly the same wish/problem with UTF8 + BOM and thank you for the notepad solution. Until today I was using tiny c program that I made that does exactly that: adds 3 bytes (0xEF,0xBB,0xBF) at the beginning of file.

I hope author will ad checkbox with this functionality to this great app in "export row values" one day.

Please login to leave a reply, or register at first.