[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] Comment/Uncomment feature patch

From: Benno Schulenberg
Subject: Re: [Nano-devel] Comment/Uncomment feature patch
Date: Sat, 21 May 2016 20:01:50 +0200

On Sat, May 21, 2016, at 18:07, Mike Scalora wrote:
> Does nano support multibyte encoding other than UTF-8?

No.  See in nano.c, where it checks nl_langinfo for being "UTF-8"
before it will activate the multibyte stuff.  (Also, somewhere
in move_mbleft() we assume that we can step back four bytes and
then safely resynchronize.  Possibly not all multibyte encodings
can do that.)

> Is this "permitted"?
>     if (is_blank_mbchar(s+p) || (mblen(s+p, MB_CUR_MAX) == 1 && s[p] == '\r'))

Yes.  But you don't even need the mblen() -- in utf8 it is impossible
that one code is part of another code.  So this is enough:

     if (is_blank_mbchar(s+p) || s[p] == '\r'))


-- - The way an email service should be

reply via email to

[Prev in Thread] Current Thread [Next in Thread]