Jump to content

Perhaps: Output encoding error in Au3Check.exe?


Go to solution Solved by SOLVE-SMART,

Recommended Posts

Posted (edited)

Hi folks, hi @Jos 👋 ,

am I right that you Jos handle or support the Au3Check.exe or is it managed by another developer?
Anyhow, let me explain. Maybe it's not an issue at all, but I have to ask 😅 .

  1. I created a file with a german umlaut (ä, ö, ü ...), in this case a "ä".
    ==> The file is Erklärung.au3.
  2. I setup an error in the file (simply use Local in a Global space).
    Local $sTest = ''
  3. I call Au3Check.exe this way "Au3Check.exe -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 C:\my\path\Erklärung.au3".
  4. I get the warning output as expected, but also a wrong file path (the occurenced file).
    ==> ...my\path\Erklõrung.au3

image.thumb.png.f666b282267c2ea120d3c8228acfed35.png

⚠ The point is: In VSCode, the Au3Check.exe is called to get warnings or errors and the output will be used in the "PROBLEMS" section. But since Au3Check returns a wrong encoded string, it is not possible to jump to this file through VSCode.

image.png.14a39019dc2c1807a8e9cf981ee42561.png

💡 In other words: Could you test it and even better fix this encoding issue please for the Au3Check.exe 😊 ?

Best regards
Sven

----------

Tested with AutoIt 🏷 v3.3.16.1 and 🏷 v3.3.17.0

Edited by SOLVE-SMART

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

  • Solution
Posted (edited)

Just FYI: I created a pull request (PR) with a fix (more likely a work-around) to solve the issue. Still it would be fine to have a more universal Au3Check program regarding encodings 😀 . I am looking forward to @LoganCH for a review of the PR.

Thanks for the attention and cheers.

Best regards
Sven

-----------------------

Update: I marked this as solution, because it's the fix for all of those who don't use the 🏷 Au3Check Beta v3.3.17.1 version already.

Edited by SOLVE-SMART

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Posted

Thanks for the hint @ioa747 👌 . But no, the same wrong encoded string (file path) is returned as output.

Best regards
Sven

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

  • Developers
Posted

I know this issue exists and that is why I have made this workaround in autoit3wrapper for it, copying the script to a temp filename and using that to be able to jump to errors in the original file.

I do touch the  au3check occasionally, but it isn't my favorite sourcecode to open due to my lack of understanding of flex & yacc.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

Okay, thank you @Jos for the explanation and for sharing the work-around.

To be honest: There seems not to be a bigger issue, because nobody complained about this before (as far as I know). For me personally it's fine as Au3Check is, because of a working work-around in VSCode*.

50 minutes ago, Jos said:

I do touch the  au3check occasionally, but it isn't my favorite sourcecode to open due to my lack of understanding of flex & yacc.

Totally understandable 🤝 . So just for the protocol 😅 , no adjustment in Au3Check, right? Then I would close this topic and extend the GitHub pull request by these informations.

Best regards
Sven

-----------

* By simply not taken the file path from the StdOut of Au3Check, only take the "check" result of it. The file path is known in VSCode before the Au3Check is called, so this string will be taken.

Edited by SOLVE-SMART

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

  • Developers
Posted (edited)

I took a quick look using VSCODE, but to me the OUTPUT Tab of AutoIt3Wrapper shows the correct filename, it is the PROBLEMS Tab showing the wrong name.
So could it be something in the VSCODE that does this "translation/lexing" of the output that is going wrong?

Output Tab:

>Running AU3Check (3.3.17.0)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\josva\AppData\Local\Temp\AutoIt3WrapperRunTmpFiles\ErklurungUTF8.au3
"c:\Development\AutoIt3\programs\test\test\ErklärungUTF8.au3"(2,17) : warning: $b: possibly used before declaration.
$a = "aäeë" & $b
~~~~~~~~~~~~~~~~^
"c:\Development\AutoIt3\programs\test\test\ErklärungUTF8.au3"(2,17) : error: $b: undeclared global variable.
$a = "aäeë" & $b
~~~~~~~~~~~~~~~~^

Problems Tab:

image.png.7b233c65d82362e6f5ad3abd7cdad9cb.png

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

Yes it's only an issue for the "PROBLEMS" tab. But no, it's not VSCode specific, it's how @LoganCH uses the Au3Check output in the VSCode extension. No AutoIt3Wrapper (as far as I understand the VSCode extension) is used. The Au3Check is called and the result is read and transfered into the PROBLEMS tab. But the string of the path which came from Au3Check, is also used and this results into the "Erkl?rung.au3" instead of "Erklärung.au3".

I cannot upload another images here, my limit is reached, so please see this link .
Or directly the code diff view here .

(1) = The used regex pattern to get the Au3Check output information
(2) = the matches
(3) = the fix/work-around (yellow marked is "scriptPath" which is not used anymore (when this will be accepted by Logan))

For other tabs, there is a different behavior, thats why it's specific to Au3Check.
As far as I can understand, if the VSCode extension would also apply your described work-around by the AutoIt3Wrapper temp file, it could work?! But this show way is more easy I think.

I hope this can clear it a bit up 😀 .

Best regards
Sven

Edited by SOLVE-SMART

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

  • Developers
Posted (edited)

Please post the output shown in the OUTPUT tab when you run Au3Check.

Ctrl+F5 always runs the AutoIt3Wrapper for me to perform au3check, even when I have configured:

"autoit.checkPath": "C:\\Program Files (x86)\\AutoIt3\\Au3Check.exe",

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Ahhh okay, now I believe I understood what you mean by AutoIt3Wrapper.au3.

Here is the OUTPUT tab .

The VSCode extension don't use the wrapper for the PROBLEMS tab functionality. It calls Au3Check.exe directly. When I run CTRL+F5 to get the Au3Check result, the VSCode extension takes the way by the wrapper (like you described and can be seen in the screenshot).

Best regards
Sven

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Posted

Which VSCode extension do you use @ioa747?

Or the newer one by @genius257?

I will also check the behavior of both extensions soon (today).

Thanks and best regards
Sven

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

  • Developers
Posted (edited)

Think I have solved the Codepage issue by changing the following:

  1. Set the console output of au3check to UTF8
  2. Convert the Input filename to UTF8 for all ConsoleOutput.

Please give this au3check Beta v3.3.17.1 a try: https://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/Au3Check.exe and see if that also fixes it for you.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Thanks @Jos, please hold the line ... 😂 . Result should be available in an hour or so.

Best regards
Sven

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Posted

🏷 Au3Check Beta v3.3.17.1 works fine @Jos 👌 .

I think I still let the pull request be active (open) and this one will hopfully be reviewed by @LoganCH soon.
Why? Because even when you provide this new Au3Check version, which is really nice - I appriciate it - not very much people already use the beta version.
When this will be released as a productive new AutoIt (tools) version, then I can redo the changes in the VSCode extension.
Understandable?

Best regards
Sven

Btw.: 🤔 I don't know where to set the "Mark as Solution" mark. Because you fixed the Au3Check.exe Jos, but this won't work for those who use the VSCode extension without this newest beta. So my "fix" is a solution for now - yours (the better one) for later on.

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

  • Developers
Posted
2 minutes ago, SOLVE-SMART said:

Understandable?

Whatever you prefer....   I am going to use this updated version going forward, as I like to avoid workarounds when not needed, and like to make these utilities a future-proof as possible. :) 


 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...