Re: Git messes up 'ø' character

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Den 20.01.2015 21:45, skrev Ævar Arnfjörð Bjarmason:
On Tue, Jan 20, 2015 at 9:17 PM, Noralf Trønnes <notro@xxxxxxxxxxx> wrote:
Den 20.01.2015 21:07, skrev Torsten Bögershausen:
On 2015-01-20 20.46, Noralf Trønnes wrote:
could it be that your "ø" is not encoded as UTF-8,
but in ISO-8859-15 (or so)

$ git log -1
commit b2a4f6abdb097c4dc092b56995a2af8e42fbea79
Author: Noralf Tr<F8>nnes <notro@xxxxxxxxxxx>
What does
git config -l | grep Noralf | xxd
say ?

$ git config -l | grep Noralf | xxd
0000000: 7573 6572 2e6e 616d 653d 4e6f 7261 6c66  user.name=Noralf
0000010: 2054 72f8 6e6e 6573 0a                    Tr.nnes.

$ file ~/.gitconfig
/home/pi/.gitconfig: ISO-8859 text
What's happened here is that:

  1. You've authored your commit in ISO-8859-1
  2. Git itself has no place for the encoding of the author name in the
commit object format
  3. git-format-patch has a --compose-encoding which I think would sort
this out if you set it to ISO-8859-1, but it defaults to UTF-8
  4. Your patch is actually a ISO-8859-1 byte sequence, but is
advertised as UTF-8
  5. You end up with a screwed-up commit

You could work around this, but I suggest just joining the 21st
century and working exclusively in UTF-8, it makes things much easier,
speaking as someone with 3x more non-ASCII characters their his name
than you :)


Ok, then the question is: How do I switch to UTF-8?

To me it seems I'm already using it:
$ locale charmap
UTF-8

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]