[SERVER-11137] CSV Export with special (swiss) latin chars looking bad in CSV Created: 11/Oct/13  Updated: 10/Dec/14  Resolved: 22/Nov/13

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 2.5.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: jackblackch Assignee: Shaun Verch
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

on MongoHQ Platform


Participants:

 Description   

Problem:
We from Switzerland have signs like "Ö", Ü, Ö and those chars are also stored in our fields in our MongoDB

In our application all works fine with that "special chars". While reading from DB and Saving everything works fine...

But not in CSV exports.

I'm exporting my docs successfull to csv over CLI with:
mongoexport --host xy.mongohq.com --port 10082 --username XY --password XY --db appXY --collection moment --csv --out /Users/millien/Projects/amag/_export/contacts.csv --fields name,email,ip,text,createdAt,isVisible

In the exported CSV every special sign (Ö,Ä,Ü and others) are replaced with not readable chars like
Ü = FÌ_nf

Seems to be an encoding problem.
Can you help us? Is there a way to set encoding of exports? I didn't find something.

Thanks and best regards from Switzerland



 Comments   
Comment by Shaun Verch [ 22/Nov/13 ]

Seems to work for me both in 2.5.0 and 2.5.5:

> db.swiss.insert({"name":"Ö,Ä,Ü"})
> exit
bye
$ mongoexport -d test -c swiss
connected to: 127.0.0.1
{ "_id" : { "$oid" : "528f7f652aebe07e5239c262" }, "name" : "Ö,Ä,Ü" }
exported 1 records

Comment by Daniel Pasette (Inactive) [ 15/Oct/13 ]

What OS version and exact version are you running with? can you run mongoexport --version? I am unable to reproduce this using latest from the master branch.

Generated at Thu Feb 08 03:25:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.