Export CSV (a lot of extra symbols)

imGuaimGua Member Posts: 1,089
When I export CSV with a simple text made in GS . I got a lot of symbols that shouldn't be there. What am I doing wrong? http://gyazo.com/f2fc671cfc3ec3d1a7e899af122de1f0

Comments

  • CodeWizardCodeWizard Inactive, Chef Emeritus Posts: 1,143
    @imGua
    That's an odd problem. Can you tell us more about how you're making this happen? Got an example project you can share?
  • CodeWizardCodeWizard Inactive, Chef Emeritus Posts: 1,143
    @imGua
    Looking into this now.
  • CodeWizardCodeWizard Inactive, Chef Emeritus Posts: 1,143
    edited May 2013
    @imGua
    Okay, so the problem seems to be that you're using commas in data that's being exported into CSV. This causes the code to escape your hand-entered commas with backslash. It looks like this code is also escaping other letters too.

    Looking into the code shows me that it's XML-escaping your exported data. That means that any characters not supported in an XML file are escaped according to the XML standard-ish. So "&" becomes "& amp;" I say "ish" because we also escape commas, newlines, tabs and line feeds.

    You can read more about XML escaping here: http://stackoverflow.com/questions/1091945/where-can-i-get-a-list-of-the-xml-document-escape-characters

    So, I'm not sure that this is the best way to handle CSV export. I'll bounce stuff off the team and find out if there's a good reason we do it this way. I'm open to any suggestions here too. :)
Sign In or Register to comment.