Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lszzy opened this issue Sep 21, 2022 · 1 comment
Labels
fixed in master Fixed in master, awaiting next update kind:bug

Comments

@lszzy
Copy link

lszzy commented Sep 21, 2022

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
  }
@lszzy lszzy added the kind:bug label Sep 21, 2022
@ramont-stripe ramont-stripe added the fixed in master Fixed in master, awaiting next update label Oct 4, 2022
@ramont-stripe
Copy link
Contributor

Hi @lszzy,

Thank you for reporting this. We just released a fix for this issue in v22.8.3:
https://github.com/stripe/stripe-ios/releases/tag/22.8.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in master Fixed in master, awaiting next update kind:bug
Projects
None yet
Development

No branches or pull requests

2 participants