Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi there,
So, I got a database that possibly has a Latin1 encoding for the text fields. I say possibly because it's a DB that's not being supported that well anymore by the original designers and I have to deal with it within my company. The text shows incorrect characters like "niños" = "niños" which means "boys" or "children" in Spanish.
So I would want to convert the encoding by using something like this:
= Table.AddColumn(#"Added Custom1", "Encoded Column ", each Text.FromBinary(Text.ToBinary([article_name], TextEncoding.Ascii), TextEncoding.Utf8))
Now instead of ASCII, obviously it should be "Latin1". But Power BI doesn't seem to have support for that. What's the alternative then?
Solved! Go to Solution.
try writing like this:
Text.FromBinary(....... , 1252)
Text.FromBinary(....... ,TextEncoding.Utf8)
Text.FromBinary(Text.ToBinary([Column1],1252),TextEncoding.Utf8))
maybe you will need another unicode :
Text.FromBinary(....... , 1145)
Text.FromBinary(....... ,TextEncoding.Utf8)
Text.FromBinary(Text.ToBinary([Column1],1145),TextEncoding.Utf8))
or
Text.FromBinary(....... , 1256)
Text.FromBinary(....... ,TextEncoding.Utf8)
Text.FromBinary(Text.ToBinary([Column1],1256),TextEncoding.Utf8))
try writing like this:
Text.FromBinary(....... , 1252)
Text.FromBinary(....... ,TextEncoding.Utf8)
Text.FromBinary(Text.ToBinary([Column1],1252),TextEncoding.Utf8))
maybe you will need another unicode :
Text.FromBinary(....... , 1145)
Text.FromBinary(....... ,TextEncoding.Utf8)
Text.FromBinary(Text.ToBinary([Column1],1145),TextEncoding.Utf8))
or
Text.FromBinary(....... , 1256)
Text.FromBinary(....... ,TextEncoding.Utf8)
Text.FromBinary(Text.ToBinary([Column1],1256),TextEncoding.Utf8))
Thank you so much Ahmedx!! You're a genius!
1252 did the trick. The only weird thing was, it was the first one I tried and it didn't seem to work. Even rotated through the output encoding (utf-8, windows, and others). Finally, I tried the 1251 and utf-8 combination again and suddenly it worked. Don't know if there was something cached before or whatever.
Your example looks like UTF-8 mis-stored in ANSI. You might be able to forcibly interpret whatever you get from that database as UTF-8.
There aren't many options otherwise: TextEncoding.Type - PowerQuery M | Microsoft Learn
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!