On Oracle Database 19c with NLS_CHARACTERSET: “AL32UTF8”.
ORA-40474: invalid UTF-8 byte sequence in JSON data is returned from the query:
select
json_object( key 'text' value replace( chr(160), chr(160), unistr('\00a0') ) )
as col2
, json_object( key 'text' value chr(160) ) -- [Error] Execution (8: 6): ORA-40474: invalid UTF-8 byte sequence in JSON data
as col3
from dual
Aren't chr(160) and unistr('\00a0') the same character?
Isn't JSON_OBJECT suppose to automatically escape this character?
Has this been fixed in Oracle Database 23ai?