Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-20 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 05.04.2012 23:16, Bruno Haible wrote: > Hi Vladimir, > >> it is best to split the test into two parts: a part >>> that can be executed on every machine, and a part which can only be executed >>> on a system with a UTF-8 locale. This way, the first part is not skipped >>> just because the system

Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-05 Thread Bruno Haible
Hi Vladimir, > it is best to split the test into two parts: a part > > that can be executed on every machine, and a part which can only be executed > > on a system with a UTF-8 locale. This way, the first part is not skipped > > just because the system has no UTF-8 locale. > > Ok, will do. Can I i

Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-05 Thread Vladimir 'φ-coder/phcoder' Serbinenko
I hope I hooked it in correctly. Couldn't check yet -- Regards Vladimir 'φ-coder/phcoder' Serbinenko diff --git a/lib/argp-fmtstream.c b/lib/argp-fmtstream.c index 70e3eb8..2db995c 100644 --- a/lib/argp-fmtstream.c +++ b/lib/argp-fmtstream.c @@ -29,9 +29,11 @@ #include #include #include +#

Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-05 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 05.04.2012 21:18, Bruno Haible wrote: > - test-mbsstr2.c is a test that requires a UTF-8 locale. We use the > French one for simplicity. (If a system does not have fr_FR.UTF-8 > installed, it would be unlikely that it has ru_RU.UTF-8 installed.) Actually not so true. In case of Debian

Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-05 Thread Vladimir 'φ-coder/phcoder' Serbinenko
> Please take a look how it's done in module 'mbsstr-tests': > - test-mbsstr1.c is a test that doesn't need a particular locale. > - test-mbsstr2.c is a test that requires a UTF-8 locale. We use the >French one for simplicity. (If a system does not have fr_FR.UTF-8 >installed, it would b

Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-05 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 05.04.2012 21:18, Bruno Haible wrote: > Hi Vladimir, > mbsnwidth returns -1 in such a case only if the option MBSW_REJECT_INVALID > is passed as third argument. If you pass 0, mbsnwidth will not return -1; > instead, it will assume width 1 for every invalid byte or unprintable > character. Ok, w

Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-05 Thread Bruno Haible
Hi Vladimir, > > - The functions __argp_get_display_len and add_length don't write to > > the memory delimited by 'beg', 'end', 'ptr, 'end'. Therefore it is good > > style to declare these parameters as being 'const char *' rather than > > 'char *'. The general rule of thumb is: Use 'const c

Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-05 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 05.04.2012 17:58, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > On 05.04.2012 14:32, Bruno Haible wrote: > > Remaining is the issue due to escape sequences. Fixed patch. Now with highlight sequence support. >> - You have shown a test case as a Cyrillic string. But what is the C code >> to mak

Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-05 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 05.04.2012 14:32, Bruno Haible wrote: > Hi Vladimir, > >> I'm not sure if previous time I sent with or without \0 bugfix. Resending > > > - The function __argp_get_display_len looks very similar to mbsnwidth(), > from module 'mbswidth'. Could you use that function? One of the gnulib > princi

Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-05 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 05.04.2012 14:32, Bruno Haible wrote: > - The function __argp_get_display_len looks very similar to mbsnwidth(), > from module 'mbswidth'. Could you use that function? One of the gnulib > principles is to reuse code that is already in gnulib, where it makes sense. I've noticed another proble

Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-05 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 05.04.2012 14:32, Bruno Haible wrote: > Hi Vladimir, > >> I'm not sure if previous time I sent with or without \0 bugfix. Resending > Thanks. I apologize for not following up on the update that you sent in > [1] and the test case in [2]. > > The approach of the patch looks fine now; but there ar

Re: [PATCH, resend] Handle multibyte codepoint width properly

2012-04-05 Thread Bruno Haible
Hi Vladimir, > I'm not sure if previous time I sent with or without \0 bugfix. Resending Thanks. I apologize for not following up on the update that you sent in [1] and the test case in [2]. The approach of the patch looks fine now; but there are a couple of minor problems that would be nice to

[PATCH, resend] Handle multibyte codepoint width properly

2012-04-03 Thread Vladimir 'φ-coder/phcoder' Serbinenko
I'm not sure if previous time I sent with or without \0 bugfix. Resending -- Regards Vladimir 'φ-coder/phcoder' Serbinenko diff --git a/lib/argp-fmtstream.c b/lib/argp-fmtstream.c index 70e3eb8..148bfda 100644 --- a/lib/argp-fmtstream.c +++ b/lib/argp-fmtstream.c @@ -29,6 +29,7 @@ #include #i