3

I have an Android project and I am using Git in Ubuntu.

I can commit my project just fine and read it correctly on github.com

But when I download it on Windows or Mac, I get some characters encoded differently (this for string in .java files for example, but not in strings.xml).

Researching I got to this stackoverflow question, which led me to this page: https://github.com/kblees/git/wiki. But here they only talk about file names being encoded differently and commit messages. What I need to know is how to fix the content of the files that are being downloaded to Windows and Mac

I'm assuming is due to something I need to set on Git.

Thanks for your help

Community
  • 1
  • 1
marimaf
  • 5,382
  • 3
  • 50
  • 68
  • Hi Marima: have you looked at http://stackoverflow.com/questions/11052199/convert-git-repository-file-encoding ? – Ahmed Masud May 25 '13 at 00:49
  • Hi Ahmed, I tried that solution but for some reason I get a "command not found" message for the script – marimaf May 25 '13 at 01:41
  • iconv is missing on your system? – Ahmed Masud May 25 '13 at 01:42
  • it says I have iconv in the Mac, I have never used it before though – marimaf May 25 '13 at 01:48
  • 1
    Your editors need to be set to the same encoding. Git has nothing to do with this. You would have the same problem if you copied the file to a USB stick and then tranfered them to your Windows PC or your Mac. – Nikos C. May 25 '13 at 11:03

1 Answers1

4

Git does not touch the encoding of your files. The issues you are having are probably caused by your editors.

Chronial
  • 66,706
  • 14
  • 93
  • 99
  • You are totally right, since I was working with eclipse in all the different OS I didn't think about this. I opened the files with a different text editor and the problem wasn't there. I ended up changing the encoding properties from the eclipse project and the problem was solved. Thanks! – marimaf May 25 '13 at 23:49