AutoHotkey Community

It is currently May 27th, 2012, 6:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: May 1st, 2011, 9:58 am 
Offline

Joined: October 18th, 2006, 3:58 am
Posts: 14
Hi all. I mainly use Autohotkey to quickly type accented and otherwise obscure Unicode glyphs not normally accessible via the keyboard (e.g. macrons and dots over or under characters, etc).

The basic syntax is like this:

Code:
:c*?:.A+::      ; user types .A+, which should give U+1EA0 (A with dot underneath)
uc = Ạ
Goto, uni

:c*?:.a+::      ; user types .a+, which should give U+1EA1 (a with dot underneath)
uc = ạ
Goto, uni

uni:
   Transform, Clipboard, Unicode, %uc%
   Send ^v
   return


This works perfectly for almost everything, with the exception of a handful of characters whose double-byte codes (the bit after uc =) end in a no-break space (U+00A0), in which case the keyboard input is replaced by nothing (i.e. it's deleted, not replaced).

I'm on XP. The behaviour occurs in AutoHotkey 1.0.48 (which I know is old), but also in the latest AutoHotkey_L (v1.1.00.00), with the following syntax:

Code:
:c*?:.A+::Ạ ; (= Ạ - should give A with dot underneath)
:c*?::G+::Ġ ; (= Ä  - should give G with dot over)
:c*?::S+::Ṡ ; (= á¹  - should give S with dot over)
:c*?:-G+::Ḡ ; (= Ḡ- should give G with macron over)
... etc


Strangely, not all characters whose double-byte codes end in no-break space are affected. From my own list of several hundred substitutions, the only characters affected by this are those in the example above, namely Ạ Ġ Ṡ and Ḡ - all of whose doublebyte codes end in no-break space.

The problem is definitely not font-related.

Could someone please have a look at the double-byte code parser and see what it does with no-break spaces.

Many thanks

[Moved from Bug Reports. ~jaco0646]


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 1st, 2011, 2:47 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Both scripts work for me on Windows XP and 7 - the first with AutoHotkey Basic, the second with AutoHotkey_L. The first script did not work in Notepad on XP (just gave squares), but it worked in Notpad on 7 and Wordpad on XP and 7. However, I did have to replace the space after Ạwith a non-breaking space (I presume your browser, my browser or the forum software screwed up).
bluegecko wrote:
Could someone please have a look at the double-byte code parser and see what it does with no-break spaces.
Aside from the file-reading code in AutoHotkey_L (which you can verify is working correctly by simply using MsgBox), there is no "double-byte code parser". Besides, most of those characters are triple-byte UTF-8 sequences. AutoHotkey Basic doesn't do anything with your "UTF-8" string beside pass it to the operating system's conversion function. Since Transform Unicode in AutoHotkey Basic and hotstrings in AutoHotkey_L have very little in common, it seems more likely that the problem is with the program you're using or your system.

I'd suggest you should make sure your file is saved as UTF-8 when using AutoHotkey_L, but you'd probably have more broken hotstrings if it wasn't already.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 1st, 2011, 9:17 pm 
Offline

Joined: October 18th, 2006, 3:58 am
Posts: 14
Lexikos,

Your report of the script working fine prompted me to try it again today, and to my surprise it now works. I presume the code was broken in the older version of AutoHotKey I'd been using, bits of which hung about in memory after I installed AutoHotKey-L. One reboot later, voila...

Thanks for your swift reply, and my apologies for the wild goose chase.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: batto, Bing [Bot], Exabot [Bot], JSLover, sjc1000 and 61 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