Sign in to follow this  
Followers 0
beserk1

ANSI characters

9 posts in this topic

I am trying to make a script will print out a set of ansi characters, such as the ones shown here.

The following code doesn't seem to do what I want

For $i = 128 to 255 Step 1
    MsgBox(0, "", $i & @CR & Chr($i))
Next

It can display fine for $i < 128, but from 128 and onwards, all it gives me is blank.

Is there anyway to display these ansi characters?

Share this post


Link to post
Share on other sites



Your script works fine and really should display correctly. What is your Windows version, language, codepage, default display font and did you change it?


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)

Share this post


Link to post
Share on other sites

WinXP SP2, regional language is set to Chinese (Hong Kong S.A.R)

what do you mean language, codepage and default display font? is it setting from autoit?

Share this post


Link to post
Share on other sites

Most seem to work in English, but not all.

The language is based on what is installed

Run("notepad.exe")
WinWaitActive("")

For $i = 128 To 255 Step 1

    ControlSend("Untitled", "", "Edit1", $i & @CR & Chr($i) & @CRLF)

    Sleep(100)

Next

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

WinXP SP2, regional language is set to Chinese (Hong Kong S.A.R)

Well, that seems to mean that your codepage is 950 defined as ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) on MSDN.

If this is correct, then it's no surprise you see nothing. Look at this charset in the 0x00..0xFF range here. Codepage 950 is the big5 alphabet that doesn't map 1:1 to Unicode. Look here to understand why. The range 0x81..0xFF is used to introduce character codes > 0xFF and don't have meaning by themselves. MS calls his DBCS (double byte character set).

Hope this answers your questions.


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)

Share this post


Link to post
Share on other sites

ok, so what do I need to change to my system in order to get this working as intended?

Share this post


Link to post
Share on other sites

First, there is nothing "wrong" with your system: what you see seems perfectly as it should be, even is this disappoints you.

It all depends of what precisely _you_ intend to display. Spend some time to play with the charmap.exe standard windows applet, changing font and charset (using the "advanced" display. Depending on what support is installed on your system, you could see that every different codepage maps the character_value XX to different character representation. That's all the purpose of codepages: being able to represent cyrillic, western, arabic, indian, ... characters within a limited range.

The drawback is that if I give you a text file, I need to tell you which codepage it uses, or it will likely appear gribberish for you if your system doesn't use the exact same codepage.

The advent of Unicode (borrowing most of UCS) allowed a simple text file to use a unique representation (once a UTFencoding is chosen) for everyone, without having tomess with a large number of incompatible codepages.

To better understand the issue(s) here is some enjoyable reading that will enlighten you: http://www.joelonsoftware.com/articles/Unicode.html

You can also benefit of reading nearly every Joel article as well!

You can play with Unicode here.


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)

Share this post


Link to post
Share on other sites

Now if you really want/need to use, say, one of the Western Latin codepages, you could add support for other languages/input methods easily. Use the "language toolbar" or if this one is hidden, go to configuration panel, regional options (may be called otherwise for you) and look at options offered under Languages and Advanced tabs. Again, I don't have the same version as you, so your applets or menus could call differently.


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)

Share this post


Link to post
Share on other sites

changed my language display to English, got it working, thanks

Share this post


Link to post
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
Sign in to follow this  
Followers 0