From: Jonathan Nieder <jrnieder@gmail.com>
To: "İsmail Dönmez" <ismail@namtrac.org>
Cc: git@vger.kernel.org
Subject: Re: Encoding problem on OSX?
Date: Wed, 11 Aug 2010 04:23:11 -0500 [thread overview]
Message-ID: <20100811092311.GA16901@burratino> (raw)
In-Reply-To: <AANLkTi=sBNmMoZmqO_-AFNO6bVqtJmXbdXYUf7-bKars@mail.gmail.com>
İsmail Dönmez wrote:
> Downgrading my sed to v 4.1.5 fixed the issue. Thanks for your help!
I just read BUGS in the sed distribution. Strangely enough the above seems to
be correct behavior:
Another common localization-related problem happens if your input stream
includes invalid multibyte sequences. POSIX mandates that such
sequences are _not_ matched by `.', so that `s/.*//' will not clear
pattern space as you would expect. In fact, there is no way to clear
sed's buffers in the middle of the script in most multibyte locales
(including UTF-8 locales). For this reason, GNU sed provides a `z'
command (for `zap') as an extension.
However there is still a sed bug as far as I can tell, since in the
test suite, LC_ALL is set to C, and using the C locale is the
suggested workaround in the GNU sed docs. This explains where my
first suggested diagnostic messed up: presumably
printf 'Th\360\235\204\236s\n' | LC_ALL=C sed "s/.*//"
would print
<treble clef>s
and
printf 'Th\370\235\204\236s\n' | sed "s/.*//"
would print
????s
with your copy of sed 4.2.1.
Well, I learned something new today. Still thinking over how to fix
this in the test suite. Thanks again.
next prev parent reply other threads:[~2010-08-11 9:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTikh12guRxCK2Vf=WvshzX8P-fYTyu3qxYWNJ2px@mail.gmail.com>
2010-08-09 13:58 ` Encoding problem on OSX? İsmail Dönmez
2010-08-09 23:46 ` Jonathan Nieder
2010-08-10 5:52 ` İsmail Dönmez
2010-08-11 7:55 ` Jonathan Nieder
2010-08-11 8:20 ` İsmail Dönmez
2010-08-11 8:29 ` Jonathan Nieder
2010-08-11 8:33 ` İsmail Dönmez
2010-08-11 8:44 ` Jonathan Nieder
2010-08-11 8:47 ` İsmail Dönmez
2010-08-11 9:01 ` İsmail Dönmez
2010-08-11 9:23 ` Jonathan Nieder [this message]
2010-09-27 2:31 ` Jonathan Nieder
2010-09-27 5:15 ` Kevin Ballard
2010-09-27 5:18 ` İsmail Dönmez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100811092311.GA16901@burratino \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=ismail@namtrac.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).