[NSAttributedString initWithData:options:documentAttributes:error:] will create string with wrong encoding, when input is HTML document type and content is non ASCII english.
| Originator: | siu.ying | ||
| Number: | rdar://16430055 | Date Originated: | 2014-03-26 |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | 7.1 |
| Classification: | Reproducible: | always |
Summary: Given a HTML document with non-english content, when using [NSAttributedString initWithData:options:documentAttributes:error:] to create NSAttributedString, the content will be invalid (looks like broken and in incorrect encoding) Steps to Reproduce: 1. Use [NSAttributedString initWithData:options:documentAttributes:error:] to create string with HTML content including chinese, japanese or any language that is not encoded in ASCII 2. Use document option NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType 3. Set the result NSAttributedString to any UIKit element Expected Results: The attributed string should be proper string without encoding issue. Actual Results: The attributed string is broken with encoding issue. Version: iOS 7.1 Notes: Configuration: Sample Project: http://cl.ly/0t073V041s0A
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!