File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -457,7 +457,8 @@ where
457
457
break ;
458
458
}
459
459
}
460
- u8:: from_str_radix ( & octet_content, 8 ) . unwrap ( ) as char
460
+ let value = u32:: from_str_radix ( & octet_content, 8 ) . unwrap ( ) ;
461
+ char:: from_u32 ( value) . unwrap ( )
461
462
}
462
463
463
464
fn parse_unicode_name ( & mut self ) -> Result < char , LexicalError > {
@@ -1596,7 +1597,7 @@ mod tests {
1596
1597
1597
1598
#[ test]
1598
1599
fn test_string ( ) {
1599
- let source = r#""double" 'single' 'can\'t' "\\\"" '\t\r\n' '\g' r'raw\'' '\200\0a'"# ;
1600
+ let source = r#""double" 'single' 'can\'t' "\\\"" '\t\r\n' '\g' r'raw\'' '\420' '\ 200\0a'"# ;
1600
1601
let tokens = lex_source ( source) ;
1601
1602
assert_eq ! (
1602
1603
tokens,
@@ -1629,6 +1630,10 @@ mod tests {
1629
1630
value: String :: from( "raw\\ '" ) ,
1630
1631
is_fstring: false ,
1631
1632
} ,
1633
+ Tok :: String {
1634
+ value: String :: from( "Đ" ) ,
1635
+ is_fstring: false ,
1636
+ } ,
1632
1637
Tok :: String {
1633
1638
value: String :: from( "\u{80} \u{0} a" ) ,
1634
1639
is_fstring: false ,
You can’t perform that action at this time.
0 commit comments