NO-BREAK SPACE is incompatible with many JSON parsers including JSONSerialization.jsonObject.
I work around this by doing: replacingOccurrences(of: " ", with: " ") on the AHAP string data but this is technically an invalid parsing since NO-BREAK SPACE could appear within JSON strings.
Per, RFC 7159 The JavaScript Object Notation (JSON) Data Interchange Format:
Insignificant whitespace is allowed before or after any of the six structural characters.
ws = *(
%x20 / ; Space
%x09 / ; Horizontal tab
%x0A / ; Line feed or New line
%x0D ) ; Carriage return
NO-BREAK SPACE is incompatible with many JSON parsers including JSONSerialization.jsonObject.
I work around this by doing:
replacingOccurrences(of: " ", with: " ")
on the AHAP string data but this is technically an invalid parsing since NO-BREAK SPACE could appear within JSON strings.Per, RFC 7159 The JavaScript Object Notation (JSON) Data Interchange Format: