I have a XML file which is created in Windows. It has some Turkish characters in it.
<?xml version="1.0" encoding="iso-8859-9"?><?xml-stylesheet type="text/xsl" ?>
<DespatchAdvice xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2" xmlns:xsi="; xmlns:xs="; xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
<cbc:CustomizationID>TR1.2.1</cbc:CustomizationID>
<cbc:ProfileID>TEMELIRSALIYE</cbc:ProfileID>
<cbc:UUID>4B0F020F-6F17-4F12-BE45-25ECCEA05A25</cbc:UUID>
<cac:DespatchSupplierParty>
<cac:Party>
<cac:PostalAddress>
<cbc:StreetName>DEMİRTAŞ OSB FESLEĞEN SK.</cbc:StreetName>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cac:TaxScheme>
<cbc:Name>ULUDAĞ VERGİ DAİRESİ</cbc:Name>
</cac:TaxScheme>
</cac:PartyTaxScheme>
</cac:Party>
</cac:DespatchSupplierParty>
</DespatchAdvice>
I'm reading file with this code:
fs.readFile(uploadedDoc[0].path, "utf8", function (err, data) {
...
}
But Turkish characters not converting correctly. I also tried "latin1" or "cp1254" but no success. What should I do?