Closed sven-seyfert closed 4 months ago
Working work-around
Func _Print($sData)
Local Const $iUtf8Flag = 4
ConsoleWrite(BinaryToString(StringToBinary($sData & @LF, $iUtf8Flag)))
EndFunc
_Print('This is a test of german umlauts. Umlauts: Γ€ ΓΆ ΓΌ Γ. Emoji: π' & @CRLF)
Just out of curiosity, does it show correctly in SciTE?
Hi @vanowm , the german umlauts yes, but I cannot use emojis at all in SciTE. But I have to say, I didn't used SciTE since years - so maybe my bad in some lack of configuration π€ .
Btw: The work-around _Print()
function also has to be changed for SciTE to the ANSI flag (1) instead of UTF8 (4).
https://github.com/loganch/AutoIt-VSCode/blob/1fc45786a0755426e9a9c4c9a26dfdb0760d6453/src/ai_commands.js#L670-L686
As related lines above, a property named config.isCodePage
was used, but which is not defined in package.json
.
https://github.com/loganch/AutoIt-VSCode/pull/217
Actually, this is a regression from ad6c3ebf5978eba74dbe37a7cf4bc51561d59f8b where centralized config was introduced.
isCodePage
was generated upon initialization, its purpose was to confirm that chosen outputCodePage
is valid.
Well, I didn't check commit history.
It seems that isCodePage
don't have a definition at this moment.
Hi and thank you @Sunev π . I tested your PR change #217 manually and it works. The setting Autoit: Output Code Page
with the value windows1250
leads to correct german umlauts in the output panel π .
What I changed manually to test:
C:\Users\your-user-name-here\.vscode\extensions\damien.autoit-1.0.12\dist\extension.js
)Without the replacement, the codepage option does not work at all. My research confirmed you assumption about "isCodePage" does not have a definition.
I hope the maintainer(s) will add this fix into the master branch, thanks π .
Best regards Sven
The only issue with this change is there is no check if outputCodePage
value is valid or not, which might create errors (?)
I think that won't be a big problem, because those developers who set .outputCodeapge
should be responsible to make sure their inputs correct. And I guess they know what they are doing.
True, however vscode syncs settings between computers, therefore on one system it might be valid, on another might not (hypothetically speaking)
What about to set the default of .outputCodepage
as ANSI?
Thus most user won't even need to config this.
I recently found that VSCode lets you turn off sync for individual settings with a right-click. So, syncing might not be a big deal.
Hi π , first of all:
I really appreciate the VSCode extension and the work behind it, thanks folks π .
Problem:
The VSCode "OUTPUT" does not show the correct characters for "simple" german umlauts.
Reproducer script:
Result:
Settings:
If I adjust the codepage by setting
autoit.outputCodePage
tocp850
,utf8
orwindows1252
nothing changes in the output.β The setting seems to be not working at all? Hint: The file encoding in my VSCode is set to
UTF-8
β Do you guys see any issues that I am doing or can you reproduce this behavior?
Thanks for your time and keep staying healthy π .
Best regards Sven