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

151
Vistas
How to write to xml file with hebrew content

I have an XML file with number of Records with Hebrew content and after I read It I want to save some of the Records that satisfied special condition to new XML file, but when I wrote to this new file, the Hebrew content convert to Gibberish like this:

<record>
...
  <datafield tag="100" ind1=" " ind2=" ">
    <subfield code="a">&#x5D0;&#x5D1;&#x5D3;&#x5D9;, &#x5D0;&#x5D4;&#x5E8;&#x5DF; &#x5D1;&#x5DF; &#x5E6;&#x5D1;&#x5D9;</subfield>
    <subfield code="9">heb</subfield>
  </datafield>
...
</record>

Here is part of my code:

let writers = ['marcxml', 'iso2709', 'json', 'text'].map(type => Marc.stream(fs.createWriteStream('results\\Short Stories.' + type), type));
...
writers.forEach((writer) => writer.write(record));
...
writers.forEach(writer => writer.end());

The example of how to read and write from XML file with Marc21 encoding is taken from here: https://www.npmjs.com/package/marcjs

Note: I tried to add "utf-8" encoding but it didn't work.

about 4 years ago · Juan Pablo Isaza
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