Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

298
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda