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 11use crate :: { Key , Project , ALL_LANGUAGES } ;
22use hemtt_workspace:: WorkspacePath ;
3- use tracing:: trace;
3+ use tracing:: { trace, warn } ;
44
55#[ derive( Default , Debug ) ]
66pub struct XmlbLayout {
@@ -137,7 +137,12 @@ pub fn rapify(project: &Project) -> Option<XmlbLayout> {
137137 i32:: try_from ( translation. phrases . len ( ) ) . expect ( "overflow" ) ,
138138 ) ;
139139 for phrase in & translation. phrases {
140- write_string ( & mut translation_buffer, phrase) ;
140+ let unescaped = quick_xml:: escape:: unescape ( phrase. as_str ( ) ) ;
141+ if unescaped. is_err ( ) {
142+ warn ! ( "failed to unescape stringtable entry [{}]" , phrase) ;
143+ return None ;
144+ }
145+ write_string ( & mut translation_buffer, & unescaped. unwrap_or_default ( ) ) ;
141146 }
142147 rolling_offset += translation_buffer. len ( ) ;
143148 data. translations . push ( translation_buffer) ;
You can’t perform that action at this time.
0 commit comments