Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken characters "�" #186

Open
kirill-zhirnov opened this issue Apr 6, 2018 · 0 comments
Open

Broken characters "�" #186

kirill-zhirnov opened this issue Apr 6, 2018 · 0 comments

Comments

@kirill-zhirnov
Copy link

Hello and thanks for great product!

I am working on parsing XML which is in russian and got a bug:

xml:

<?xml version="1.0" encoding="UTF-8"?>
<КоммерческаяИнформация xmlns="urn:1C.ru:commerceml_2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ВерсияСхемы="2.07" ДатаФормирования="2016-04-23T13:02:14">
	<Каталог СодержитТолькоИзменения="false">
		<Ид>a9338328-b467-4669-bece-8050d53be19b</Ид>
		<ИдКлассификатора>a9338328-b467-4669-bece-8050d53be19b</ИдКлассификатора>
		<Наименование>Каталог товаров A9338328</Наименование>
	</Каталог>
</КоммерческаяИнформация>

script to reproduce:

const expat = require('node-expat');
const fs = require('fs');

let parser = new expat.Parser('UTF-8');
parser.on("startElement", (nodeName) => {
    console.log(nodeName);
});

fs.createReadStream('./xml/import0_1_short.xml').pipe(parser);

In the result I will get:

КоммерческаяИнформация
Каталог
Ид
ИдКлассификатор�
Наименование

The bug is in the row: ИдКлассификатор�

Why does it happen? I agree, xml in russian is a shit, but I need to parse it :(

kirill-zhirnov added a commit to kirill-zhirnov/commerceml-js that referenced this issue Apr 7, 2018
tuananh referenced this issue in tuananh/sax-parser Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant