Problems with umlaut

Fragment of a discussion from Help talk:CSV format

I've run into the same issue as well and have a patch which at least fixes it for me. I see that SMW exports the data as UTF-8, but Excel can't figure that out, and it's a bit of a hassle to import the data in the correct format. The solution to this is to add the UTF-8 byte order mark to the beginning of the string to be returned (see Also setting the delimiter to a semicolon makes Excel happy.

What I've done is add the BOM around line 106 of includes/queryprinters/SMW_QP_CSV.php:

$result .= stream_get_contents( $csv );
// Add the UTF-8 byte order mark (BOM) so that Excel can read this in as UTF-8
$result = chr(239) . chr(187) . chr(191) . $result;
16:27, 17 September 2013

I have the same problem with Excel 2013. Adding the line

$result = chr(239) . chr(187) . chr(191) . $result;

doesn't help. Has anyone an idea how to open the csv-file in Excel with the right character set?

16:11, 12 March 2015

Instead of hacking SMW core it will be more advisable to change settings in Excel. I thing this should do the trick: [1] (German only :( ). Supposedly newer versions should have similar settings, too. LibreOffice is much nicer in this respect since it politely asks upon import which charset to use.

There is also an new excel format. This may be an alternative too.


18:13, 12 March 2015

I found a solution which works for me. I replaced the line:

$result = chr(239) . chr(187) . chr(191) . $result;


$result = iconv("UTF-8", "CP1252", $result);
12:58, 17 March 2015