From d0016d746c4ba016e77fda0bb26719ca581dcfc0 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 4 Sep 2019 09:27:22 -0400 Subject: [PATCH] Read the highlighted HTML source in as UTF-8. --- Source/BSSourceView.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/BSSourceView.mm b/Source/BSSourceView.mm index 37aa222..741e68b 100644 --- a/Source/BSSourceView.mm +++ b/Source/BSSourceView.mm @@ -107,7 +107,9 @@ [[errPipe fileHandleForReading] readToEndOfFileInBackgroundAndNotify]; NSData* data = [[outPipe fileHandleForReading] readDataToEndOfFile]; - NSAttributedString* source = [[NSAttributedString alloc] initWithHTML:data documentAttributes:NULL]; + NSAttributedString* source = [[NSAttributedString alloc] initWithHTML:data + options:@{ NSCharacterEncodingDocumentAttribute : @(NSUTF8StringEncoding) } + documentAttributes:nil]; [[textView_ textStorage] setAttributedString:source]; [source release]; } @catch (NSException* exception) { -- 2.22.5