Special characters in CSV

0
Hi, In our application, customers can create a CSV file, but some special characters aren’t exported as is, but as a ‘?’ instead. Example; Name in application: Çayır Name in CSV export file: Çay?r See below for the special characters. Does someone know how to fix this? Correct: ÀàÁáÂâÄäÃã Çç ÈèÉéÊêËë ÌìÍíÎîÏï Ññ ÒòÓóÔôÖöÕõ ÙùÚúÛûÜü Ýý ÿ Not correct: ĀāĄąĂăǍǎ ĈĉČčĆćĐđĎď ĘęĒēĔĕĖėĚěĜĝĞğĠġĢģǦǧĤĥĦħ ĮįİıĨĩĪīĬĭĴĵĶķǨǩĹĺĻļĽľĿŀŁłŃńŅņ Ňň ŐőǪǫŌōŎŏƠơŔŕŖŗŘřŚśŜŝŞşȘșŠšŤťŦŧŢţȚț ŨũŪūŬŭŲųŮůŰűƯưŴŵ ŶŷŸ ŹźŽžŻż UPDATE: I used the Java Action AppendContentToFileOQL from SimpleCSVExporter. But have a solution: I have to map the results to an non-persisent object first, then create an CSV string and then the Java action StringToFileCRLF. Thanks!
asked
1 answers
3

Rens,

I just tried this with a grid and the default export to CSV button that the modeler provides and when exporting the characters you mention all characters are exported correctly. Checked this in the file with a standard text editor and via excel. Tested this on a W7 machine with the build in db.

Are you using the standard mendix button or are you creating the csv's with custom code? If the latter, then you'll need to take care to set the correct character encoding to be used (UTF-8) for exporting.

Another issue might be that if you try to open the csv with excel the default character encoding of the operating system could be used. This could be cp1252 and then the text would look as described in your question.

Same applies when the csv file is UTF-8 encoded without BOM, opening the file in excel after I changed the encoding will have the text garbled as well.

So there could be different causes for the problem you are experiencing, I hope the answers above will provide you with options to investigate and find a solution.

answered