Closed
Description
Summary
SimpleScanViewController displays garbled characters in languages such as Chinese
Code to reproduce
SimpleScanViewController.swift line 270
if let attributedString = try? NSAttributedString(data: stringData, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil) {
privacyLinkText.attributedText = attributedString
}
iOS version
All versions.
Installation method
Podfile
SDK version
22.8.2
Other information
How to Fix: Add parameter .characterEncoding and set it to utf8 when html decoding
Example:
if let attributedString = try? NSAttributedString(data: stringData, options: [.documentType: NSAttributedString.DocumentType.html, .characterEncoding: NSNumber(value: String.Encoding.utf8.rawValue)], documentAttributes: nil) {
privacyLinkText.attributedText = attributedString
}