Jump to content

Diacritical characters replaced/deleted in string


Jakub-M
 Share

Recommended Posts

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

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 here
RegExp tutorial: enough to get started
PCRE 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

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 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 here
RegExp tutorial: enough to get started
PCRE 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

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 here
RegExp tutorial: enough to get started
PCRE 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

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
 Share

  • Recently Browsing   0 members

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