user1320847
user1320847

Reputation:

Git and file content (text) encoding (utf8)

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!

Upvotes: 1

Views: 5134

Answers (1)

michas
michas

Reputation: 26495

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.

Upvotes: 2

Related Questions