Locale option for fast-xml-parser #447
-
We are trying to convert a xml which has non-english characters to json using library fast-xml-parser. But In options we are using localeRange: 'a-zA-Zа-яёА-ЯЁ'. But it is converting some characters to unknown characters. For Ex: the word "Carátula" is converted to "Cartula". Following are the options we are using: const options = {
attributeNamePrefix: '@',
attrNodeName: '',
textNodeName: '#text',
ignoreAttributes: false,
ignoreNameSpace: false,
allowBooleanAttributes: false,
parseNodeValue: true,
parseAttributeValue: false,
trimValues: false,
decodeHTMLchar: false,
cdataTagName: '__cdata',
cdataPositionChar: '\\c',
localeRange: 'a-zA-Zа-яёА-ЯЁ'
}
const tObj = fastXmlParser.getTraversalObj(sourceData, options);
const json = fastXmlParser.convertToJson(tObj, options); Please let us know what we are missing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Locale option had been removed long time back as all the supported range is supported instead of English character only. Can you please try with latest version of FXP for better support. FXP doesn't perform any operation on any character range separately. |
Beta Was this translation helpful? Give feedback.
Locale option had been removed long time back as all the supported range is supported instead of English character only. Can you please try with latest version of FXP for better support. FXP doesn't perform any operation on any character range separately.