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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Bhatt23
Helper I
Helper I

Converting Document display name from Y2020 行业应用案例单页汇总.pdf to normal character

Hi Guys,

I need your urgent support with a bizzare case wherein I am importing Data from a Json file which is extracting data from API call using power shell script. So, in this there are multiple columns but I am pulling Document Display name out of all which has different document name according to the country but in Json itself the document name is getting changed to 

Y2020 行业应用案例单页汇总.pdf which is not correct name it is getting changed for all the documents name with letters apart from English. Also while looking into the text file in Visual Studio I found this pop up "This file has large number non basic ascii unicode characters".

So while importing JSON file in Power BI I tried below formula in Power query to change to UTF16 as per the previous post in cummunity below screenshot is the result, Also tried UTF8 nothing changed.

#"Added Custom" = Table.AddColumn(#"Duplicated Column", "Custom", each Text.FromBinary(Text.ToBinary([#"displayName - Copy"], 1251), TextEncoding.Utf16))

But it is changing all the names even if it is English as per the below screenshot.

Bhatt23_0-1698765612208.png


What I want to achieve is to convert only the name without normal English character to there original character.
Let me know in case anyone has any clue about this or can help.

7 REPLIES 7
pfarias
Advocate I
Advocate I

In the sample 'Y2020 行业应用案例单页汇总.pdf', what the result expect?

Y2020 行业应用案例单页汇总.pdf this is the expected result for the example I have shared but this column contains mix of all the display name like some in english some in chinese some Japanese etc. the one in english is fine but only issue is with other language like this example one.

If this is expected result, the erro is before the 'Y2020 行业应用案例单页汇总.pdf'. Because these characters I'll not be convert to Y2020 行业应用案例单页汇总.pdf.

 

Can you talk more about how is generated this encoding char?

Thanks for your response, well this 'Y2020 行业应用案例单页汇总.pdf' code is generated via a export file. Actually we are running to API call to extract these details from a external App which is creating JSON file and default file format is UTF-8 but only characters apart from English is getting converted to this code.
Let me know in case you need more information on this please.

Bhatt23
Helper I
Helper I

It will be great help if anyone can help or advise the best solution guys really appreciate.

pfarias
Advocate I
Advocate I

Try use Encoding 1200 instead 1251.

#"Added Custom" = Table.AddColumn(#"Duplicated Column", "Custom", each Text.FromBinary(Text.ToBinary([#"displayName - Copy"], 1200), TextEncoding.Utf16))

 

Hey thanks for your input.

#"Added Custom" = Table.AddColumn(#"Duplicated Column", "Custom", each Text.FromBinary(Text.ToBinary([#"displayName - Copy"], 1200), TextEncoding.Utf16))

I tried 1200 nothing changed same result.

Bhatt23_0-1698776957291.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Kudoed Authors