Re: [PATCH v10 7/9] convert: check for detectable errors in UTF encodings

2018-03-09 Thread Lars Schneider
> On 07 Mar 2018, at 19:04, Eric Sunshine wrote: > > On Wed, Mar 7, 2018 at 12:30 PM, wrote: >> Check that new content is valid with respect to the user defined >> 'working-tree-encoding' attribute. >> >> Signed-off-by: Lars Schneider

Re: [PATCH v10 7/9] convert: check for detectable errors in UTF encodings

2018-03-07 Thread Junio C Hamano
Lars Schneider writes: > I would like to advise the dashed form as this seems to be the > canonical form and it avoids cross platform issues. My macOS > iconv does not support the form without dashes. Sure, that is why I said canonicalization without inserting dash

Re: [PATCH v10 7/9] convert: check for detectable errors in UTF encodings

2018-03-07 Thread Lars Schneider
> On 07 Mar 2018, at 23:57, Junio C Hamano wrote: > > Lars Schneider writes: > >> At this point I thought it would make sense to make the advised >> encoding name uppercase in both situations. OK with you? > > In the endgame, if upcased and

Re: [PATCH v10 7/9] convert: check for detectable errors in UTF encodings

2018-03-07 Thread Junio C Hamano
Lars Schneider writes: > In the case of has_prohibited_utf_bom() you are right as we are > dropping the BE/LE suffix in the advise. However, look at the > is_missing_required_utf_bom() advise. Here we *add* BE/LE. So? Then add BE/LE like "Utf-16BE" or "utf16BE".

Re: [PATCH v10 7/9] convert: check for detectable errors in UTF encodings

2018-03-07 Thread Lars Schneider
> On 07 Mar 2018, at 23:32, Junio C Hamano wrote: > > Lars Schneider writes: > >> I also would have liked to advise "UTF-16" instead of "UTF16" as >> you suggested. However, that required a few more lines and I wanted >> to keep the change to a

Re: [PATCH v10 7/9] convert: check for detectable errors in UTF encodings

2018-03-07 Thread Junio C Hamano
Lars Schneider writes: > I also would have liked to advise "UTF-16" instead of "UTF16" as > you suggested. However, that required a few more lines and I wanted > to keep the change to a minimum. I feel this could be added in a > follow up patch. I'd say the whole

Re: [PATCH v10 7/9] convert: check for detectable errors in UTF encodings

2018-03-07 Thread Lars Schneider
> On 07 Mar 2018, at 20:49, Junio C Hamano wrote: > > lars.schnei...@autodesk.com writes: > >> +static int validate_encoding(const char *path, const char *enc, >> + const char *data, size_t len, int die_on_error) >> +{ >> +/* We only check for UTF here

Re: [PATCH v10 7/9] convert: check for detectable errors in UTF encodings

2018-03-07 Thread Junio C Hamano
lars.schnei...@autodesk.com writes: > +static int validate_encoding(const char *path, const char *enc, > + const char *data, size_t len, int die_on_error) > +{ > + /* We only check for UTF here as UTF?? can be an alias for UTF-?? */ > + if (startscase_with(enc, "UTF")) {

Re: [PATCH v10 7/9] convert: check for detectable errors in UTF encodings

2018-03-07 Thread Eric Sunshine
On Wed, Mar 7, 2018 at 12:30 PM, wrote: > Check that new content is valid with respect to the user defined > 'working-tree-encoding' attribute. > > Signed-off-by: Lars Schneider > --- > diff --git a/convert.c b/convert.c > @@ -266,6 +266,58

[PATCH v10 7/9] convert: check for detectable errors in UTF encodings

2018-03-07 Thread lars . schneider
From: Lars Schneider Check that new content is valid with respect to the user defined 'working-tree-encoding' attribute. Signed-off-by: Lars Schneider --- convert.c| 55 +++