Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
kondado
Advocate III
Advocate III

Problem with special character encoding (Possibly Latin1)

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?

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

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))

 


Screen Capture #654.png

 

View solution in original post

3 REPLIES 3
Ahmedx
Super User
Super User

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))

 


Screen Capture #654.png

 

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.

lbendlin
Super User
Super User

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors