Skip to content

Commit 907dd41

Browse files
committed
fixup! Strip Unicode Cf characters in PrintableString
1 parent c1c66e7 commit 907dd41

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lightning-types/src/string.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn is_format_char(c: char) -> bool {
6767
| 0xFFF9..=0xFFFB
6868
| 0x110BD
6969
| 0x110CD
70-
| 0x13430..=0x13440
70+
| 0x13430..=0x1343F
7171
| 0x1BCA0..=0x1BCA3
7272
| 0x1D173..=0x1D17A
7373
| 0xE0001
@@ -101,5 +101,12 @@ mod tests {
101101
"PrintableString left a U+202E RLO override in its output: {:?}",
102102
rendered
103103
);
104+
105+
// U+13440 is in the Egyptian Hieroglyph Format Controls block, but its
106+
// general category is `Mn`, not `Cf`, so the `Cf` range ends at U+1343F.
107+
assert_eq!(
108+
format!("{}", PrintableString("x\u{1343F}y\u{13440}z")),
109+
"x\u{FFFD}y\u{13440}z"
110+
);
104111
}
105112
}

0 commit comments

Comments
 (0)