Search code examples
pythonutf-8scp

SCP converts German characters from Mac to Ubuntu


I am using a Mac texteditor and I have some a csv file that contains some German characters:

schönheit & gesundheit,1,Yes,03/04/17,-1,1141,in stock,-1,enabled,

I am using scp to copy the file from my computer to the server:

scp -C -i key.pem -r file.csv ubuntu@54.0.0.0:file.csv

However what I get is this

sch~Znheit & gesundheit,1,Yes,03/04/17,-1,1141,in stock,-1,enabled,

and I cannot parse the file with these character.

Do you have any ideas how to resolve this?


Solution

  • SCP converts German characters from Mac to Ubuntu

    No, scp is a binary protocol and it transfers bit to bit. Problem is your editor and its encoding configuration. Open the file in MAC, check what character encoding is used there and when opening the file in Ubuntu, use the same encoding.

    Or convert the file initially to UTF-8 to avoid such problems.