[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] Comment/Uncomment feature patch
From: |
Mike Scalora |
Subject: |
Re: [Nano-devel] Comment/Uncomment feature patch |
Date: |
Sat, 21 May 2016 10:07:59 -0600 |
On Sat, May 21, 2016 at 3:21 AM, Benno Schulenberg
<address@hidden> wrote:
> > is_blank_mbchar
> ...
> The first one, yes. And you can't just s++ through a string;
> you need to use move_mbright().
>...
> (Strangely, is_blank_mbchar() doesn't consider \r to be blank, so
> when editing an unconverted DOS file, a line that is factually
> empty isn't considered as such.)
>...
> Benno
Does nano support multibyte encoding other than UTF-8? I see all the C
library mb functions wrapped in #ifdef UTF8 which leads me to thing we
only support UTF-8 or the flag is a bad name for multibyte.
Is this "permitted"?
if (is_blank_mbchar(s+p) || (mblen(s+p, MB_CUR_MAX) == 1 && s[p] == '\r'))
Otherwise I think the following is more "multibyte clean". If we only
support UTF-8 mb, I think the simpler code above works but maybe
doesn't follow the mb dogma to support non-UTF-8 mb encoding locals.
#ifdef ENABLE_UTF8
wchar_t c;
if (is_blank_mbchar(s+p) || (mbstowcs(&c, s+p, MB_CUR_MAX) > 0 &&
c == L'\r'))
#else
if (isblank(s+p) || s[p] == '\r'))
#endif
-Mike
- Re: [Nano-devel] Comment/Uncomment feature patch, (continued)
- Re: [Nano-devel] Comment/Uncomment feature patch, Mike Frysinger, 2016/05/17
- Re: [Nano-devel] Comment/Uncomment feature patch, Benno Schulenberg, 2016/05/18
- Re: [Nano-devel] Comment/Uncomment feature patch, Mike Scalora, 2016/05/18
- Re: [Nano-devel] Comment/Uncomment feature patch, Benno Schulenberg, 2016/05/19
- Re: [Nano-devel] Comment/Uncomment feature patch, Mike Scalora, 2016/05/19
- Re: [Nano-devel] Comment/Uncomment feature patch, Benno Schulenberg, 2016/05/19
- Re: [Nano-devel] Comment/Uncomment feature patch, Mike Scalora, 2016/05/20
- Re: [Nano-devel] Comment/Uncomment feature patch, Benno Schulenberg, 2016/05/21
- Re: [Nano-devel] Comment/Uncomment feature patch, Mike Scalora, 2016/05/20
- Re: [Nano-devel] Comment/Uncomment feature patch, Benno Schulenberg, 2016/05/21
- Re: [Nano-devel] Comment/Uncomment feature patch,
Mike Scalora <=
- Re: [Nano-devel] Comment/Uncomment feature patch, Benno Schulenberg, 2016/05/21
- Re: [Nano-devel] Comment/Uncomment feature patch, Mike Scalora, 2016/05/22
- [Nano-devel] getting ready to merge the Comment/Uncomment feature, Benno Schulenberg, 2016/05/22
- Re: [Nano-devel] getting ready to merge the Comment/Uncomment feature, Mike Scalora, 2016/05/22
- Re: [Nano-devel] getting ready to merge the Comment/Uncomment feature, Benno Schulenberg, 2016/05/25
- Re: [Nano-devel] Comment/Uncomment feature patch, Benno Schulenberg, 2016/05/19
- Re: [Nano-devel] Comment/Uncomment feature patch, Benno Schulenberg, 2016/05/15