Re: Git messes up 'ø' character

2015-01-20 Thread Noralf Trønnes

Den 20.01.2015 23:18, skrev Nico Williams:

On Tue, Jan 20, 2015 at 10:38:40PM +0100, Noralf Trønnes wrote:

Yes:
$ echo Noralf Trønnes | xxd
000: 4e6f 7261 6c66 2054 72f8 6e6e 6573 0aNoralf Tr.nnes.

Is there a command I can run that shows that I'm using ISO-8859-1 ?
I need something to google with, my previous search only gave locale
stuff, which seems fine.

The locale(1) command tells you what your locale is set to, but it
doesn't say anything about your input method -- it only tells you what
your shell and commands started from it expect for input and what they
should produce for output.

The input method will generally be part of your windowing environment,
for which you'll have to search how to check/configure your OS
(sometimes it can be set on a per-window basis, sometimes it's a global
setting).

Even if the windowing environment is set to UTF-8, your terminal
emulator might be set to ISO-8859-something, so check the terminal
emulator (e.g., rxvt, Terminator, GNOME Terminal, PuTTY, ...).


I use putty which was set to ISO-8859-1. Changing this to UTF-8 gave me 
the correct result:

$ echo Noralf Trønnes | xxd
000: 4e6f 7261 6c66 2054 72c3 b86e 6e65 730a  Noralf Tr..nnes.

Thank you all for helping me!

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


Re: Git messes up 'ø' character

2015-01-20 Thread Noralf Trønnes

Den 20.01.2015 22:26, skrev Ævar Arnfjörð Bjarmason:

On Tue, Jan 20, 2015 at 10:23 PM, Noralf Trønnes  wrote:

Den 20.01.2015 21:45, skrev Ævar Arnfjörð Bjarmason:


On Tue, Jan 20, 2015 at 9:17 PM, Noralf Trønnes  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 Trnnes 

What does
git config -l | grep Noralf | xxd
say ?


$ git config -l | grep Noralf | xxd
000: 7573 6572 2e6e 616d 653d 4e6f 7261 6c66  user.name=Noralf
010: 2054 72f8 6e6e 6573 0aTr.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

Your .gitconfig has an ISO-8859-1 string, from an earlier mail of yours:


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

On a system configured for UTF-8 this would be:

$ echo Noralf Trønnes | xxd
000: 4e6f 7261 6c66 2054 72c3 b86e 6e65 730a  Noralf Tr..nnes.

Note the "f8" v.s. "c3 b8".



Yes:
$ echo Noralf Trønnes | xxd
000: 4e6f 7261 6c66 2054 72f8 6e6e 6573 0aNoralf Tr.nnes.

Is there a command I can run that shows that I'm using ISO-8859-1 ?
I need something to google with, my previous search only gave locale 
stuff, which seems fine.


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


Re: Git messes up 'ø' character

2015-01-20 Thread Noralf Trønnes

Den 20.01.2015 21:45, skrev Ævar Arnfjörð Bjarmason:

On Tue, Jan 20, 2015 at 9:17 PM, Noralf Trønnes  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 Trnnes 

What does
git config -l | grep Noralf | xxd
say ?


$ git config -l | grep Noralf | xxd
000: 7573 6572 2e6e 616d 653d 4e6f 7261 6c66  user.name=Noralf
010: 2054 72f8 6e6e 6573 0aTr.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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Git messes up 'ø' character

2015-01-20 Thread Noralf Trønnes

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 Trnnes 

What does
git config -l | grep Noralf | xxd
say ?


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

$ file ~/.gitconfig
/home/pi/.gitconfig: ISO-8859 text

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


Git messes up 'ø' character

2015-01-20 Thread Noralf Trønnes

I can't get my name: Noralf Trønnes, to come out correctly when I
format and send a patch. The 'ø' becomes a question mark when received
in my email client.

This is the head of the patch file generated by git format-patch:

From b2a4f6abdb097c4dc092b56995a2af8e42fbea79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=F8nnes?= 
Date: Tue, 20 Jan 2015 18:34:47 +0100
Subject: [PATCH] staging: fbtft: remove ARCH_BCM2708 optimization
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

ARCH_BCM2708 is not present in mainline so remove optimization.

Signed-off-by: Noralf Trønnes 
---

$ git log -1
commit b2a4f6abdb097c4dc092b56995a2af8e42fbea79
Author: Noralf Trnnes 
Date:   Tue Jan 20 18:34:47 2015 +0100

staging: fbtft: remove ARCH_BCM2708 optimization

ARCH_BCM2708 is not present in mainline so remove optimization.

Signed-off-by: Noralf Trnnes 

$ git send-email --to no...@tronnes.org 
0001-staging-fbtft-remove-ARCH_BCM2708-optimization.patch

0001-staging-fbtft-remove-ARCH_BCM2708-optimization.patch
(mbox) Adding cc: =?UTF-8?q?Noralf=20Tr=F8nnes?=  
from line 'From: =?UTF-8?q?Noralf=20Tr=F8nnes?= '
(body) Adding cc: Noralf Trønnes  from line 
'Signed-off-by: Noralf Trønnes '


From: =?UTF-8?q?Noralf=20Tr=F8nnes?= 
To: no...@tronnes.org
Subject: [PATCH] staging: fbtft: remove ARCH_BCM2708 optimization
Date: Tue, 20 Jan 2015 20:25:24 +0100
Message-Id: <1421781924-3066-1-git-send-email-no...@tronnes.org>
X-Mailer: git-send-email 2.2.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The Cc list above has been expanded by additional
addresses found in the patch commit message. By default
send-email prompts before sending whenever this occurs.
This behavior is controlled by the sendemail.confirm
configuration setting.

For additional information, run 'git send-email --help'.
To retain the current behavior, but squelch this message,
run 'git config --global sendemail.confirm auto'.

Send this email? ([y]es|[n]o|[q]uit|[a]ll): y
OK. Log says:
Server: smtp.ebnett.no
MAIL FROM:
RCPT TO:
From: =?UTF-8?q?Noralf=20Tr=F8nnes?= 
To: no...@tronnes.org
Subject: [PATCH] staging: fbtft: remove ARCH_BCM2708 optimization
Date: Tue, 20 Jan 2015 20:44:15 +0100
Message-Id: <1421783055-3117-1-git-send-email-no...@tronnes.org>
X-Mailer: git-send-email 2.2.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Result: 250 2.0.0 Ok: queued as B49BB8014D



Setup:

Ubuntu server
$ cat /etc/issue
Ubuntu 12.04.3 LTS \n \l

$ git --version
git version 2.2.2

$ git config -l
user.name=Noralf Trønnes
user.email=no...@tronnes.org
core.editor=nano
alias.serve=daemon --verbose --export-all --base-path=/home/pi --reuseaddr
sendemail.smtpserver=smtp.ebnett.no
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.staging-testing.remote=origin
branch.staging-testing.merge=refs/heads/staging-testing


Regards,
Noralf Trønnes

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