Forum

XML encoding not ac...
 
Notifications
Clear all

XML encoding not accepted on import

3 Posts
3 Users
0 Reactions
308 Views
(@Anonymous)
Posts: 0
New Member Guest
 

I would like to import an xml file with this header:

<?xml version="1.0" encoding="windows-1250"?>

Some text are encoded for example:

<data>
   <faktury>
      <faktura>
          <zdroj>Fakturácia</zdroj>

Using New Source - File -Xml command I get the attached table, where all non-english characters are unreadable.

PowerQueryEncodingError.png

How to achieve the correct encoding for xml file?

 
Posted : 13/07/2016 5:59 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Gejza,

In your query go back to the 'Source' step and click on the gear icon. In the dialog box under the File Origin choose 1252: Western European (Windows).

Then go back to the last step and the characters should display correctly.

Please let me know if it doesn't work.

Mynda

 
Posted : 13/07/2016 7:59 am
(@lfcost)
Posts: 1
New Member
 

Hi,

If you use a function, for instance combining all SAF-T xml files of a folder, you can change the function code in the advanced editor you can change the Xml.Tables parameters, from Source = Xml.Tables(Parameter1) to Source = Xml.Tables(Parameter1,[],1252)

[] for null

1252 the encode number

let
Source = (Parameter1) => let
Source = Xml.Tables(Parameter1,[],1252),
Table1 = Source{1}

,
Table2 = Table1{2}

in
Table2
in
Source

 

Cheers

Luís

 
Posted : 11/09/2020 6:50 am
Share: