Skip to content

Commit

Permalink
Write non-ASCII steno strokes to escapes as well
Browse files Browse the repository at this point in the history
  • Loading branch information
sammdot committed Jan 1, 2021
1 parent 3648d3d commit 1452dc5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ impl Entry {

pub fn write(&self, writer: &mut dyn io::Write) -> Result<(), io::Error> {
write!(writer, "{{\\*\\cxs {}}}{}{}\n",
self.steno, format_plover_to_rtf(&self.translation),
self.steno.chars().map(|c|
if (c as u32) > 255 { format!("\\u{} ", c as u32) }
else { String::from(c) }).collect::<Vec<String>>().join(""),
format_plover_to_rtf(&self.translation),
match &self.metadata {
Some(EntryMetadata { comment: Some(comment) }) =>
format!("{{\\*\\cxcomment {}}}", comment),
Expand Down

0 comments on commit 1452dc5

Please sign in to comment.