Skip to content

[BUG] SimpleScanViewController displays garbled characters in languages such as Chinese in version 22.8.2 #2015

Closed
@lszzy

Description

@lszzy

Summary

SimpleScanViewController displays garbled characters in languages such as Chinese

WechatIMG1214

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
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions