Jakub-M Posted February 18, 2018 Share Posted February 18, 2018 Hi I am from slovakia, autoit is wonderfull, but when I create slovakian scripts/applications, that autoit not accept slovakian alphabeticaly extended characters ľ,č,ť.... even, in default, this is unable to be writen or diacritical mark on characters is missing after writing to editor. It can be resolved by opening file in notepad, and saved in UTF-8 encoding, but: For example, I want get netsh adapters, (adapter names for use with netsh command) I run "netsh interface show interface" in Run() in cmd Then I read CMD window by PID: $cmdline=StdoutRead($PID2) But sometimes adapter name contains diacritics, for example: "Lokálne pripojenie" $cmdline string contain "Lok lne pripojenie" simply, á character is replaced by spacebar. I tried to rename my adapter and use name: "Lokálne pripojenie ľščťžýáíéóú" $cmdline after this contains "Lok lne pripojenie –çźś§ě ˇ‚˘Ł" Is some way to resolve this, or solution is not exist for autoit? Such problems with diacritics in autoit is more. Tkanks Link to comment Share on other sites More sharing options...
jchd Posted February 18, 2018 Share Posted February 18, 2018 You're capturing stdout from CMD, which uses the default codepage defined by your system settings. What does "chcp" return when run in a CMD window? Try to change default CMD charset to Unicode before running netsh. Use "chcp 65001" to switch console to UTF8. You should then capture UTF8 strings. Store the file below and run "type utf8.txt" in a console under that directory. You'll see weird-looking text. Now run "chcp 65001" and then "type utf8.txt" to see the difference. utf8.txt Note that the chinese text won't show correctly unless you have the Windows asian charsets extension installed. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Jakub-M Posted February 18, 2018 Author Share Posted February 18, 2018 thanks "chcp" return: Active code page: 852 when i use code page 65001 then read from stdout: Lokálne pripojenie ľščťžýáĂéóú still no good, I tested other pagesets and not working Link to comment Share on other sites More sharing options...
jchd Posted February 18, 2018 Share Posted February 18, 2018 (edited) The UTF8 you read from stdout needs to be converted to UTF16-LE which AutoIt uses. Try this: ; $s is your UTF8 string Local $Str = BinaryToString(StringToBinary($s, 4), 1) EDIT: exchange 4 and 1 as noticed by OP. Sorry for mistake. Edited February 18, 2018 by jchd This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Jakub-M Posted February 18, 2018 Author Share Posted February 18, 2018 I use Local $Str = BinaryToString(StringToBinary($s, 1), 4) change 4 and 1 instead of your hint code and it works properly Question is, how encoding is used for stdoutread returned text, because I must use charset 65001 for cmd and flag 1 in StringToBinary() Link to comment Share on other sites More sharing options...
Zedna Posted February 18, 2018 Share Posted February 18, 2018 (edited) @Jakub Look here My Examples using this Ansi2Oem and Oem2Ansi conversion: EDIT: General explanation: In GUI is used ANSI codepage (1250 in Czech) and in CUI commandline is used OEM codepage (852 in Czech) PS: I'm from Czech republic ;-) Edited February 18, 2018 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
jchd Posted February 18, 2018 Share Posted February 18, 2018 GUI uses Unicode in Windows since ... long time ago. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now