From: Robert Buck <buck.robert.j@gmail.com>
To: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Cc: "git@vger.kernel.org List" <git@vger.kernel.org>,
msysGit <msysgit@googlegroups.com>
Subject: Re: [RFC/PATCH v3 4/5] Rename "crlf" attribute as "eolconv"
Date: Thu, 13 May 2010 09:19:15 -0400 [thread overview]
Message-ID: <AANLkTikat4Da_XXz8xYH9La_I3n31THIhGA_onGGm0VU@mail.gmail.com> (raw)
In-Reply-To: <014C9B00-800C-465D-A0B9-98BEEB7D7A96@gmail.com>
On Thu, May 13, 2010 at 7:47 AM, Eyvind Bernhardsen
<eyvind.bernhardsen@gmail.com> wrote:
> On 13. mai 2010, at 11.58, Robert Buck wrote:
>
>> Quick question here, while people would be in the convert.c functions
>> when making the above changes. This question is related to detecting
>> whether a file is text, but the question could be spun off to a
>> different thread if you so wish...
>>
>> Have you considered skipping the UTF8 BOM and provided that the
>> remaining content is considered text allow auto conversions? The check
>> is simple, and would cover at least 50% of latin-derived languages.
>> Since you have the buffer at hand, and are in the same file
>> (convert.c), simply check for an initial EF BB BF. This would fix some
>> text files created on Windows (someone had mentioned Notepad I
>> believe). Out of the box experience for eol and text detection for
>> Windows users would be improved.
>
> I just did a quick test with a plain text file; it was detected as text both with and without a utf8 BOM. Looking at the code, characters >= 128 are considered printable so the BOM shouldn't make any difference at all. Do you have an example utf8 text file that is misdetected as binary?
Sorry, my bad. I misread a line in convert.c. It handles UTF-8 beautifully.
next prev parent reply other threads:[~2010-05-13 13:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-12 23:00 [PATCH v3 0/5] End-of-line normalization, redesigned Eyvind Bernhardsen
2010-05-12 23:00 ` [PATCH v3 1/5] autocrlf: Make it work also for un-normalized repositories Eyvind Bernhardsen
2010-05-12 23:00 ` [PATCH v3 2/5] Add tests for per-repository eol normalization Eyvind Bernhardsen
2010-05-12 23:00 ` [PATCH v3 3/5] Add " Eyvind Bernhardsen
2010-05-12 23:00 ` [RFC/PATCH v3 4/5] Rename "crlf" attribute as "eolconv" Eyvind Bernhardsen
2010-05-13 1:38 ` Linus Torvalds
2010-05-13 9:39 ` Robert Buck
2010-05-13 9:58 ` Robert Buck
2010-05-13 11:47 ` Eyvind Bernhardsen
2010-05-13 13:19 ` Robert Buck [this message]
2010-05-14 10:16 ` utf8 BOM Dmitry Potapov
2010-05-15 20:23 ` Eyvind Bernhardsen
2010-05-16 5:19 ` Dmitry Potapov
2010-05-16 10:37 ` Eyvind Bernhardsen
2010-05-16 11:26 ` Tait
2010-05-16 13:32 ` Dmitry Potapov
2010-05-13 10:59 ` [RFC/PATCH v3 4/5] Rename "crlf" attribute as "eolconv" Eyvind Bernhardsen
2010-05-13 21:45 ` Linus Torvalds
2010-05-14 2:34 ` Robert Buck
2010-05-14 4:56 ` Jonathan Nieder
2010-05-14 21:21 ` Eyvind Bernhardsen
2010-05-14 21:32 ` Eyvind Bernhardsen
2010-05-14 21:16 ` Eyvind Bernhardsen
2010-05-14 21:27 ` Linus Torvalds
2010-05-15 20:47 ` [PATCH] Add "core.eol" variable to control end-of-line conversion Eyvind Bernhardsen
2010-05-16 10:39 ` Robert Buck
2010-05-12 23:00 ` [RFC/PATCH v3 5/5] Rename "core.autocrlf" config variable as "core.eolconv" Eyvind Bernhardsen
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=AANLkTikat4Da_XXz8xYH9La_I3n31THIhGA_onGGm0VU@mail.gmail.com \
--to=buck.robert.j@gmail.com \
--cc=eyvind.bernhardsen@gmail.com \
--cc=git@vger.kernel.org \
--cc=msysgit@googlegroups.com \
/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).