mirror of
https://github.com/soywod/himalaya.git
synced 2024-11-25 04:20:22 +00:00
parse raw message as ut8 lossy (#234)
Reading a message raw uses uses utf_lossy to ensure the message can be read even if there is invalid utf8.
This commit is contained in:
parent
eaa83b71ef
commit
09d3de5e6f
1 changed files with 2 additions and 1 deletions
|
@ -212,7 +212,8 @@ pub fn read<'a, OutputService: OutputServiceInterface, ImapService: ImapServiceI
|
|||
imap: &mut ImapService,
|
||||
) -> Result<()> {
|
||||
let msg = if raw {
|
||||
String::from_utf8(imap.find_raw_msg(&seq)?)?
|
||||
// Emails don't always have valid utf8. Using "lossy" to display what we can.
|
||||
String::from_utf8_lossy(&imap.find_raw_msg(&seq)?).into_owned()
|
||||
} else {
|
||||
imap.find_msg(&seq)?.fold_text_parts(text_mime)
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue