ed: handle Unicode beyond the BMP correctly in list mode.

List mode was constrained to the BMP. This change introduces
the following new list mode convention, using Go string literal syntax:

Non-printing ASCII characters display as \xhh.
Non-ASCII characters in the BMP display as \uhhhh.
Characters beyond the BMP display as \Uhhhhhhhh.
This commit is contained in:
sean 2020-05-21 16:10:30 +01:00 committed by Russ Cox
parent 3850e6e177
commit 95220bf887
2 changed files with 42 additions and 11 deletions

View file

@ -441,10 +441,18 @@ a backspace as
.LR \eb ,
backslashes as
.LR \e\e ,
and non-printing characters as
and non-printing ASCII characters as
a backslash, an
.LR x ,
and four hexadecimal digits.
and two hexadecimal digits.
non-ASCII characters in the Basic Multilingual Plane
are printed as a backslash, a small
.LR u ,
and four hexadecimal digits; and characters above the
Basic Multilingual Plane are printed as a backslash,
a big
.LR U ,
and six hexadecimal digits.
Long lines are folded,
with the second and subsequent sub-lines indented one tab stop.
If the last character in the line is a blank,