Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

297
Views
Are these characters valid for XML?

Is this valid XML data (the value of the messageContent in particular)?

I am getting it from an API.

I then get an error when I pass this XML down to a Postgres function for saving to the Postgres DB.

<rows>

<row messageDateUTC="2020-06-01T21:20:37.120" 

texterAddress="" texterStreet="" messageContent="Hey beautiful it&apos;s Scott!&#55357;&#56842;"  />


</rows>

I wonder if it's an API issue, or a problem with the client-side module which generates the XML, or maybe Postgres has an issue and is not able to handle these characters.

Error here:

Caused by: org.postgresql.util.PSQLException: ERROR: invalid XML content
  Detail: line 5: xmlParseCharRef: invalid xmlChar value 55357
ddress="" texterStreet="" messageContent="Hey beautiful it&apos;s Scott!&#55357;
                                                                               ^
line 5: xmlParseCharRef: invalid xmlChar value 56842
" texterStreet="" messageContent="Hey beautiful it&apos;s Scott!&#55357;&#56842;
                                                                               ^
line 23: chunk is not well balanced
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

tl;dr No, they are not valid, whatever did the encoding is either buggy or got told wrong encoding information about the input.

55357 and 56842 are 0xD83D and 0xDE0A in hex respectively.

In Unicode they are in ranges called "High Surrogate" and "Low Surrogate" respectively.

That means that they are not proper Unicode codepoints, but rather used in UTF-16 to construct a single Unicode value that doesn't fit into 16 bit (i.e. the Basic Multilingual Plane).

These two specific values decode to U+1F60A SMILING FACE WITH SMILING EYES. The correct decimal HTML entity for that would be &#128522;.

The most likely reason for this is that some transformation that either doesn't know about UTF-16 or thought this text is not UTF-16 did the encoding (but should have detected that those values are invalid and reported an error even in that case).

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!