bugGNU nano - Bugs: bug #60263, nano wrongly designates U+FDD0 to...


You are not allowed to post comments on this tracker with your current authentication level.

bug #60263: nano wrongly designates U+FDD0 to U+FDEF as invalid

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sat 20 Mar 2021 04:36:54 PM UTC  
Severity:  2 - Minor Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Closed

Wed 24 Mar 2021 07:30:42 PM UTC, comment #1: 

Fixed in git, commit de816840, by dropping the checks for the 66 non-characters from is_valid_unicode().

But... now I see that is_valid_unicode() is entirely superfluous, because mblen() and mbtowc() already consider the byte sequences that encode U+D800 to U+DFFF as invalid (returning -1), and glibc wrongly does not consider codes above U+10FFFF as invalid (see bug #60262).  Verbatim input already rejects anything above U+10xxxx, right at the input stage, and is_valid_unicode() comes far too late in display_string() because breadth() and wideness() have already (falsely) determined that codes above U+10FFFF are each a single character (instead of invalid series of four or five or six bytes).

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 20 Mar 2021 04:36:54 PM UTC, original submission:  

To reproduce, run 'nano --ignore' and type: M-V 00fdd1
Nano says: "Invalid code".

See http://www.unicode.org/faq/private_use.html#nonchar8,
and https://www.unicode.org/versions/corrigendum9.html,
and http://www.unicode.org/faq/private_use.html#sentinel6.

In that last section it says: """That correction results in the current situation for Unicode, where noncharacters /are/ valid Unicode scalar values, /are/ valid in Unicode strings, and /must/ be mapped through UTFs, whereas surrogate code points are /not/ valid Unicode scalar values, are /not/ valid in UTFs, and /cannot/ be mapped through UTFs."""

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-04-30 bens Open/ClosedOpen => Closed
    2021-03-24 bens StatusIn Progress => Fixed
    2021-03-22 bens StatusNone => In Progress
        Assigned toNone => bens

    Back to the top

    Powered by Savane 3.7