Declare UTF-8 to avoid mojibake

This commit is contained in:
Nate Weaver 2020-04-07 16:20:47 -05:00
parent 3d509a94d4
commit 06b3d2f8e1
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ struct ArticleStringFormatter {
static func attributedTruncatedTitle(_ article: Article) -> NSAttributedString { static func attributedTruncatedTitle(_ article: Article) -> NSAttributedString {
let title = truncatedTitle(article, forHTML: true) let title = truncatedTitle(article, forHTML: true)
let data = title.data(using: .utf8)! let data = title.data(using: .utf8)!
let attributed = NSAttributedString(html: data, documentAttributes: nil)! let attributed = NSAttributedString(html: data, options: [.characterEncoding: String.Encoding.utf8.rawValue], documentAttributes: nil)!
return attributed return attributed
} }