AutoHotkey Community

It is currently May 26th, 2012, 8:34 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: August 22nd, 2009, 9:08 pm 
Offline

Joined: February 17th, 2008, 5:01 pm
Posts: 303
Hi all,

In a script that I've been working on forever, I need a pair of characters that aren't typically used in strings, to use as delimeters and for marking special substrings. These characters would be used internally by the script to encode various things

My first thought is to use the ASCII BEL, BS, or EOT characters. For example, I might want to do
Code:
(For simplicity, I'm going to represent the BEL character with the string "<BEL>.")
Loop, Parse, LongString, <BEL>

However, these ASCII characters are nonprinting, so they make the code hard to read.

However, I have seen characters with umlauts and accents in AHK code.
Can anyone elighten me on what is going on here. I'd love to be able to choose arbitrary unicode characters, but I've read that AHK doesn't support unicode.

Then I wondered if maybe AHK could use the umlauted characters because it can use ANSI characters (i.e. Windows-1252). I've seen references to ASCII characters in the documentation, but never ANSI ones. Does AHK use ANSI internally?

Any information greatly appreciated. Please go easy on me, because while I've done some research, I don't have much background in this.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2009, 2:27 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
Yes, you can use characters like ñ and Ö as delimiters. AHK apparently uses the ansi code page internally, so any ansi character between 1 and 255 is ok with AHK.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2009, 4:42 am 
Offline

Joined: February 17th, 2008, 5:01 pm
Posts: 303
Thanks!

I think I've settled on using ¬, «, », and § in my script for now.

So are ANSI encodings deep in AHK in such a way that I can be confident that commands will be pretty robust? Is anyone aware of any limitations involved with using the full set of ANSI characters in AHK? I'd hate to get pretty far into a project only to discover a key limitation that renders the basic design strategy impractical.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2009, 9:09 am 
Offline

Joined: December 23rd, 2006, 6:02 pm
Posts: 424
Location: Russia
I am constantly using the full set, since cyrillic letters are mapped to the upper half of the ANSI codes. One problem with the upper codes is that they may denote different characters in different locales. In my locale, the default codepage is Windows-1251, not 1252, so my ANSI charset does not include, for example, German letters with umlauts because their codes are used for cyrillic characters. However, this is only a representation problem; AutoHotkey actually works not with characters as we see them on the screen but with character codes.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2009, 6:01 pm 
Offline

Joined: February 17th, 2008, 5:01 pm
Posts: 303
Thanks, YMP. That's very helpful to know.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, joetazz, Mickers, tidbit, tomoe_uehara and 56 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group