mogular / powerquery-formatter-examples

9 stars 1 forks source link

support of Cyrillic variable names #9

Closed maxim-uvarov closed 4 years ago

maxim-uvarov commented 4 years ago

Description Could not parse code

Power Query- / M-Code

let
    Источник = Csv.Document(Web.Contents("https://www.liveinternet.ru/stat/ru/searches.csv?slice=mobile&id=4&id=13&id=5&id=total&period=month&graph=csv"),[Delimiter=";", Columns=5, Encoding=65001, QuoteStyle=QuoteStyle.None]),
    #"Повышенные заголовки" = Table.PromoteHeaders(Источник, [PromoteAllScalars=true]),
    #"Измененный тип" = Table.TransformColumnTypes(#"Повышенные заголовки",{{"Дата", type date}, {"Google", Int64.Type}, {"Яндекс", Int64.Type}, {"Search.Mail.ru", Int64.Type}, {"всего", Int64.Type}})
in
    #"Измененный тип"

Expected behavior I just wanted to see how it works:) It seems like it doesn't support cyrrilic variables names....

Settings No special configuration

UliPlabst commented 4 years ago

I just tried to reproduce your problem but for me your query seems to be working:
example Can you please make sure if you still run into the problem. If it still persists, it's probably an issue with your environment. In that case I would need to know the browser + version you are using.

maxim-uvarov commented 4 years ago

@UliPlabst Thanks for fast reply!

I checked this code in Firefox and it does work.

I use Brave (on MacOS ) Version 1.8.96 Chromium: 81.0.4044.138 (Official Build) (64-bit) And it's strange because PowerQueryFormatter works correctly with latin-named variables with the same code...

2020-05-18_18-21-44

UliPlabst commented 4 years ago

I just downloaded this exact version of the brave browser and it's working for me (on windows). Therefore I think it's most likely a mac OS specific encoding issue with the brave browser. I asked my bosses and they told me mac OS has a history of strange encoding problems. Unfortunately I do not have access to a mac OS device and therefore cannot reproduce (or fix) this problem. I suggest you either use latin variable names or use the formatter with firefox. I know this is probably an unsatisfying solution for you. Maybe in the future I will have access to a mac OS device and will be able to further investigate this issue.