Showing results for 
Search instead for 
Did you mean: 
srgmat Frequent Visitor
Frequent Visitor

How to set the csv file encoding?


I am working with

and I would like to ask, how or where can I set the encoding of a CSV file that I import into the 

Moderator v-yuezhe-msft

Re: How to set the csv file encoding?


Connect to CSV file using Power BI Desktop instead, you are able to set encoding in Power BI Desktop, there is an example for your reference.



Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
SQLMonger Frequent Visitor
Frequent Visitor

Re: How to set the csv file encoding?



I had a similar issue, trying to import postal code data from 

Using the standard encoding ended up with junk in the text columns for non-latin languages. "BigEndian" encoding resulted in a single row, single column blob of junk being returned. A bit of trial and error determined that using the "65001: Unicode (UTF-8) encoding worked.


As an example, the code below pulls in the data from the extracted file from the above link:


    Source = Csv.Document(File.Contents("C:\Data\allCountries\allCountries.txt"),
[Delimiter="#(tab)", Columns=12, Encoding=65001, QuoteStyle=QuoteStyle.None]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type number}, {"Column11", type number}, {"Column12", Int64.Type}}), #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "Country Code"}, {"Column2", "Postal Code"}, {"Column3", "Place Name"}, {"Column4", "Admin Name1"}, {"Column5", "Admin Code1"}, {"Column6", "Admin Name2"}, {"Column7", "Admin Code2"}, {"Column8", "Admin Name3"}, {"Column9", "Admin Code3"}, {"Column10", "Latitude"}, {"Column11", "Longitude"}, {"Column12", "Accuracy"}}) in #"Renamed Columns"

Warm regards,




Helpful resources

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Top Kudoed Authors
Users Online
Currently online: 145 members 1,544 guests
Please welcome our newest community members: