Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JSON_OBJECT Non-Breaking-Space character : ORA-40474: invalid UTF-8 byte sequence in JSON data

m9716686 days ago

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?

This post has been answered by mathguy on May 10 2025
Jump to Answer
Comments
Post Details
Added 6 days ago
2 comments
81 views