Closed (won't fix)
Project:
Ubercart
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Oct 2009 at 18:05 UTC
Updated:
4 Feb 2011 at 13:45 UTC
CSV product reports can contain currency symbols such as £ which are output in UTF-8, but Excel interprets CSV files as being in ISO-8859-1 without using the text import wizard. This patch adds the UTF-8 byte order mark to the start of each CSV file so Excel will display their contents correctly.
| Comment | File | Size | Author |
|---|---|---|---|
| uc_reports-utf8-bom.patch | 737 bytes | longwave |
Comments
Comment #1
rszrama commentedHad to turn to Wikipedia to grok the byte order mark. Thanks for putting this together!
When I ran the export and looked at it in TextEdit, everything looked normal... but when I loaded it in Excel, I could see a character representation of the BOM (even though admittedly it shouldn't show up). I'm on a MacBook running Office 2008. Any thoughts on how to make that disappear?
Comment #2
longwaveI didn't realise this would cause problems for other software when I wrote this patch! Searching Google for "utf-8 excel csv" suggests this is a common problem with no good solution; it works in certain versions of Excel (the Windows version used by my client at least) but then causes problems in other versions. Google's solution is to provide a separate CSV format for Excel, which is actually tab-separated UTF-16LE. If the PHP iconv or mbstring extensions are installed there are two better solutions listed at http://php.net/manual/en/ref.mbstring.php which might be of use.
Marking as "needs work" for now, I don't have more time to work on this at the moment.
Comment #3
longwave#630058: CSV should have only figures, without any formatting would probably work better.