@@ -229,6 +229,9 @@ impl char {
229
229
'\r' => EscapeDefaultState :: Backslash ( 'r' ) ,
230
230
'\n' => EscapeDefaultState :: Backslash ( 'n' ) ,
231
231
'\\' | '\'' | '"' => EscapeDefaultState :: Backslash ( self ) ,
232
+ _ if self . is_grapheme_extended ( ) => {
233
+ EscapeDefaultState :: Unicode ( self . escape_unicode ( ) )
234
+ }
232
235
_ if is_printable ( self ) => EscapeDefaultState :: Char ( self ) ,
233
236
_ => EscapeDefaultState :: Unicode ( self . escape_unicode ( ) ) ,
234
237
} ;
@@ -692,16 +695,13 @@ impl char {
692
695
general_category:: Cc ( self )
693
696
}
694
697
695
- /// Returns true if this `char` is a nonspacing mark code point , and false otherwise.
698
+ /// Returns true if this `char` is an extended grapheme character , and false otherwise.
696
699
///
697
- /// 'Nonspacing mark code point' is defined in terms of the Unicode General
698
- /// Category `Mn`.
699
- #[ unstable( feature = "rustc_private" ,
700
- reason = "mainly needed for compiler internals" ,
701
- issue = "27812" ) ]
700
+ /// 'Extended grapheme character' is defined in terms of the Unicode Shaping and Rendering
701
+ /// Category `Grapheme_Extend`.
702
702
#[ inline]
703
- pub fn is_nonspacing_mark ( self ) -> bool {
704
- general_category :: Mn ( self )
703
+ pub ( crate ) fn is_grapheme_extended ( self ) -> bool {
704
+ derived_property :: Grapheme_Extend ( self )
705
705
}
706
706
707
707
/// Returns true if this `char` is numeric, and false otherwise.
0 commit comments