[SR-13403] UTF-8 decoding truncates replacement character #55844
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Environment
Apple Swift 5.2.4
Additional Detail from JIRA
md5: 3cc506ee44670166398aa02de6d2828e
duplicates:
Issue Description:
What's
ef
? Turns out it's a truncated form of the replacement character U+FFFD, which encodes as EF BF BD in UTF-8. I'm not sure why it's getting truncated, though.(Aside: Why am I using
init(decoding:as:)
? Because Foundation's decoding just fails on bad code units rather than falling back to a replacement character.)The text was updated successfully, but these errors were encountered: