mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-16 20:57:53 +08: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:
@@ -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)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user