Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Strange characters on output (wrong encoding?) #10

Open
eriveraa opened this issue Sep 9, 2018 · 5 comments
Open

Strange characters on output (wrong encoding?) #10

eriveraa opened this issue Sep 9, 2018 · 5 comments
Labels

Comments

@eriveraa
Copy link

eriveraa commented Sep 9, 2018

Hi, your tool is really interesting and useful, but right now i am struggled in this problem:

When i try to transform my source CSV (with utf-8 encoding), i got a output CSV (in utf-8) with strange characters like it was encoded wrong. Please your help!!!

@OlegIlyenko
Copy link
Contributor

Thanks for the kind words! I would happy to assist but it is hard to give any suggestion on how to solve "strange characters like it was encoded wrong" because it is very general description of the problem. I would appreciate if you could create a small self-contained example that reproduces the issue.

@eriveraa
Copy link
Author

eriveraa commented Sep 11, 2018

Hi Oleg, thanks for your response.
Find attached:

  • Input file: contacts_in.csv (exported from google contacts)
  • Mapping file: mapping.json
  • Output file: contacts_out.csv

The command i execute is:
d:>csv-mapper --mapping mapping.json --inCsv contacts_in.csv --outCsv contacts_out.csv

screenshot_in
screenshot_out
csv-mapper-files.zip

I hope this explain better my case. I will wait for your kind response.
Thanks in advance. Regards!

@OlegIlyenko
Copy link
Contributor

Just looked at your example. From what I can tell, contacts_in.csv is encoded in iso-8859-1:

$ file -I contacts_in.csv
contacts_in.csv: text/plain; charset=iso-8859-1

When I convert it to UTF-8. E.g. with iconv:

iconv -f iso-8859-1 -t UTF-8 contacts_in.csv > contacts_in_utf8.csv

and then run CSV mapper, it works as expected and output looks good (with all special characters preserved).

@eriveraa
Copy link
Author

Excellent, it works now. Thanks a lot!.

PD1. By the way, is there any tool like "iconv" for windows?
PD2. Are you still working on csv-mapper and release updates?

@OlegIlyenko
Copy link
Contributor

OlegIlyenko commented Sep 11, 2018

Great, glad that it is resolved 👍

By the way, is there any tool like "iconv" for windows?

TBH, i'm not sure. When I work in windows, I normally have either Cygwin or git for windows with git bash. Both of these come with iconv.exe and some other basic utils

Are you still working on csv-mapper and release updates?

Not actively. It works quite well so far I got some good feedback a while back. I don't actively use it myself nowadays and there were no issues reported, so I haven't worked on it for a while now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants