Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

159
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda