1

My problem

I'm using Git to keep track of my files and to move them between two computers. The one I work on which is on Windows 8, and the one where I compile which is under Centos 6.

I used to work with Windows XP and Bitbucket, but I recently moved to Windows 8 and Deveo.

My problem is: Let's figure out I have a file called "/example.sql" which contains: "Categoría" (Without the quotes).

Once committed and pushed, I look for the file on Deveo, which actually looks as it should: Categoría.

However, once I "git clone" or "git pull" it, it's got converted to: "Categoría"

That is really inconvenient, as the file is to be imported to MySQL as UTF8.

What I've checked for

I code in Notepad++ and I've made sure it saves the files as "UTF8 without BOM". On Centos I've checked for the file encoding with "file -bi example.sql", which reports text/x-c; charset=utf-8

My Question

What may have happend? Is it a Deveo problem? I did not have it when working on Bitbucket and Win XP How may I solve it?

Thank you!

  • You should have a look at this: http://stackoverflow.com/questions/5854967/git-msysgit-accents-utf-8-the-definitive-answers – MKAI Aug 28 '13 at 23:14
  • @MKAI: that question is about Unicode paths, not contents – Dietrich Epp Aug 28 '13 at 23:16
  • My problem is not with the paths, the file is correctly named, pulled, etc. The problem is its content (text) –  Aug 28 '13 at 23:17
  • 1
    Which computer are you getting the error on? It's possible that the file contents are correct (because if the file contains UTF-8 Categoría it will show up as CategorÃa if your text editor thinks it's Latin-1) and it's just a problem with your text editor. Git normally treats files as binary blobs so *content* encoding should be a non-issue. – Dietrich Epp Aug 28 '13 at 23:22
  • If that was the case, importing the file to MySQL should work and it should later on be displayed as í. Instead, those characters are shown. –  Aug 28 '13 at 23:29

1 Answers1

2

Wild guess: You log into your Centos box using Putty. You configured your Putty to display output as something else then utf-8. - Hence the file contains the correct string it is only displayed wrong by putty.

You can verify by something like hexdump -C example.sql.

michas
  • 25,361
  • 15
  • 76
  • 121
  • Yeah, well indeed I was aware I was using putty with non utf-8 enconding. The problem came down to be of MySQL not importing the file as it should. Sorry –  Aug 28 '13 at 23:44