Skip to content

Commit

Permalink
fix: specify text encoding as utf-8 (#4324)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiqian committed Apr 7, 2023
1 parent 79345ab commit f6f0eb7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion iina/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,9 @@ extension NSTextField {
func setHTMLValue(_ html: String) {
let font = self.font ?? NSFont.systemFont(ofSize: NSFont.systemFontSize)
let color = self.textColor ?? NSColor.labelColor
if let data = html.data(using: .utf8), let str = NSMutableAttributedString(html: data, documentAttributes: nil) {
if let data = html.data(using: .utf8), let str = NSMutableAttributedString(html: data,
options: [.textEncodingName: "utf8"],
documentAttributes: nil) {
str.addAttributes([.font: font, .foregroundColor: color], range: NSMakeRange(0, str.length))
self.attributedStringValue = str
}
Expand Down

0 comments on commit f6f0eb7

Please sign in to comment.