ahkdll: The encoding errors still occur in Ansi Version

Now Compiling and Running is ok. But the encoding errors still occur as follow

https://s8.postimg.org/ae109ghlh/encoding_error.jpg


test.exe

? ??? ??? ??? ???. Hello? ???

(TODO: ?? ?? ???)

확인

It should be as follows

test.ahk

이 번역기는 완벽한 번역기가 아닙니다.

Hello? 안녕하세요

(TODO: 다른 팁도 추가하기)

확인

Could you compile this ahk source code (test.ahk)? This ahk script occurs encoding error when it was compiled using ansi version.


test.ahk

tip=
 (
이 번역기는 완벽한 번역기가 아닙니다.

Hello?
안녕하세요
(TODO: 다른 팁도 추가하기)
 )
gosub,Tray_Init
 msgbox,% tip
 exitapp
 Tray_Init:
 Menu, Tray, NoStandard
 Menu, Tray, DeleteAll
 Menu, tray, add, 사이트 방문 , 사이트방문
return
사이트방문:
run, IEXPLORE.EXE "http://translate.google.com"
return


About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

I have finally got my head around that and it should be working properly now 😉

Thank you for your hard work! Keep up the gook work 😄

We cannot use StringUTF8ToChar due to security. What is your Codepage? MsgBox % DllCall(“GetACP”)

Check if it is working now.

Run this script in Unicode version (not compiled) and confirm if you get the desired result? tip= ( 이 번역기는 완벽한 번역기가 아닙니다.

Hello? 안녕하세요 (TODO: 다른 팁도 추가하기) ) VarSetCapacity(var,1024) DllCall(“WideCharToMultiByte”,“UInt”,949,“Uint”,0,“wStr”,tip,“UInt”,StrLen(tip)*2,“PTR”,&var,“UInt”,1024,“UInt”,0,“UInt”,0)

MsgBox % StrGet(&var,“CP0”)

Here is test of screenshot. It’s same result. https://s18.postimg.org/77jdaa1hl/ahk_h_test.jpg

Do you get correct result here? tip= ( 이 번역기는 완벽한 번역기가 아닙니다.

Hello? 안녕하세요 (TODO: 다른 팁도 추가하기) ) VarSetCapacity(var,1024) DllCall(“WideCharToMultiByte”,“UInt”,949,“Uint”,0,“wStr”,tip,“UInt”,StrLen(tip)*2,“PTR”,&var,“UInt”,1024,“UInt”,0,“UInt”,0)

MsgBox % StrGet(&var,“CP0”)

Latest Autohotkey_H is still not working. Same as follow screenshot https://s17.postimg.org/tgs71s2xb/latest_ansi_autohotkey_H_test.jpg

I think I got it now, can you try again and confirm if it is working now 😉

I see but unfortunately I can’t test it since on my system it does not display properly. Can you see if you can get this function to work for you: https://github.com/HotKeyIt/ahkdll/blob/master/source/script.cpp#L5186

Here are screenshots { Running it(test.ahk) with latest ANSI version of Autohotkey(Autohotkey.exe) without compiling And Running test.exe (compiled script) }

  1. Latest Autohotkey_H https://s17.postimg.org/tgs71s2xb/latest_ansi_autohotkey_H_test.jpg
  2. Latest Autohotkey_L https://s21.postimg.org/f24gh66nb/latest_ansi_autohotkey_L_test.jpg

Environment OS : Windows 7 Professional K - 64bit Laguage : Korean

Execute following script and upload a screenshot:

tip= ( 이 번역기는 완벽한 번역기가 아닙니다.

Hello? 안녕하세요 (TODO: 다른 팁도 추가하기) ) gosub,Tray_Init msgbox,% “IsUnicode:t" (A_IsUnicode?1:0) "nVersion:tt” A_AhkVersion “`n” tip exitapp Tray_Init: Menu, Tray, NoStandard Menu, Tray, DeleteAll Menu, tray, add, 사이트 방문 , 사이트방문 return 사이트방문: run, IEXPLORE.EXE “http://translate.google.com” return

Download ANSI version (https://autohotkey.com/download/ahk-a32.zip) and execute your script with it, you get:

? ??? ??? ??? ???.

Hello? ??? (TODO: ?? ?? ???)

Why do you think is it called ANSI?

If it worked before then it was a bug, try running it with ANSI version without compiling, also with original AutoHotkey.

ANSI version cannot display UNICODE characters!