AutoHotkey Community

It is currently May 26th, 2012, 12:29 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: September 4th, 2008, 11:34 pm 
Offline

Joined: February 28th, 2006, 8:42 am
Posts: 159
Laszlo wrote:
Why do you use the Cyrillic è character (0x0450)? It is matched with the other Cyrillic letters (smaller). The Latin-1 Supplement version (0x00E8) should be better for Latin languages with SendU.


ok, thanks lazslo, I'll try that [edit: of course it worked]. (It was the first è I saw, didnt realize they'd be different ;)

[edit: posted my results here:
http://www.autohotkey.com/forum/viewtopic.php?p=218263#218263]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2008, 5:54 pm 
Offline

Joined: March 18th, 2008, 4:04 am
Posts: 193
asci to unicode convert

how I can convert asci string to unicoce string ?

so I can use it in some API that need unicode string as input parameter.

I tried some functions suggested in ahk forum like :
DllCall("MultiByteToWideChar...
but got an empty string or only first char

is there a sample code code or syntax how to generate unicode string
so AHK can 'see' it and put it as parameter

rgrds
rani


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2008, 2:36 pm 
Offline

Joined: July 29th, 2005, 5:32 pm
Posts: 179
rani wrote:
asci to unicode convert

how I can convert asci string to unicoce string ?

so I can use it in some API that need unicode string as input parameter.
Please take a look at how SKAN did this. Keep in mind that AHK doesn't support unicode natively, but this should work fine for feeding param into your dllcall.

_________________
.o0[ corey ]0o.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2008, 7:38 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Many thanks for this great function.

I have a problem using this char: ц (1094 or 0x0446), it is not being send, any Idea why?

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2008, 7:44 pm 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
Works fine for me!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2008, 7:50 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Thanks Krogdor, I will try on a different computer.

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2008, 9:38 pm 
Offline

Joined: March 18th, 2008, 4:04 am
Posts: 193
hi Freakkk, all

I tried the SKAN ATOU,
and got same results:
the length of the Unicode string =1 ?
I think it should be the asci String Length * 2
and ofcourse the API didn't work.

do I have to change something in PC definitions ?
or add in AHK some parameter ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2008, 10:26 am 
Offline

Joined: March 18th, 2008, 4:04 am
Posts: 193
Unicode by ahk

I would like to build with ahk loop the unicode string, means:
after each char (because the string is US-ASCI)
I want to add chr(0) : means add char that asc=0
but ahk chr is in range of 1-255.

how I add(concatenate) the asci code 0 (chr(0))
in AHK script ?

this will be good enough to solve the unicode API param

rgrds
rani


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2008, 6:05 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
If you want to work with buffers containing data, not ASCII/ANSI strings, use VarSetCapacity and NumGet/Put.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2008, 11:23 pm 
Offline

Joined: March 18th, 2008, 4:04 am
Posts: 193
Hi Laszo

how is the ahk syntax to do that ?
pls note I have to set it as unicode param to dllcall
also :
the string is actually US-ASCI so it's unicode key should be like:
KEY =ABCD-1234-5678
and it's unicode is like, I think:
KEU_uni := A . CHR(0) . B . CHR(0) . C chr(0) ... and so on


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2008, 1:31 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Code:
KEY = ABCD-1234-5678                      ; your input
VarSetCapacity(KEY_uni, 2*StrLen(KEY), 0) ; allocate memory, fill it with 0's
Loop Parse, KEY                           ; each char of KEY is copied to KEY_uni
   NumPut(ASC(A_LoopField), KEY_uni, 2*A_Index-2, "Char")

Loop % 2*StrLen(KEY)                      ; TEST: collect all bytes
   t .= NumGet(KEY_uni,A_Index-1,"Char") ","
MsgBox %t%                                ; see if we did it right


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2008, 6:28 pm 
Offline

Joined: March 18th, 2008, 4:04 am
Posts: 193
Hi Laszlo,
I tried your script
and it works

but when I add the KEY_uni as a parameter in dllCall
still I get error license of the API

do I need to pass the KEY_uni not as a string but may be by address ?
means:
dllCall("MyEngine\GetObject","str",KEY_uni,oEngine)
or I saw in GDip library(by tic) something like
dllCall("MyEngine\GetObject","UInt",&KEY_uni,oEngine)

as I notice when I treat KEY_uni as AHK string AHK shows only 1st char and length=1 even by your view of KEY_uni I see KEY length*2

so I think the problem remain the KEY_uni parameter passs by dllCall.

thanks for help
rani


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2008, 6:52 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Look at the description of the GetObject function. It may require a structure in the first parameter, containing the length and the data. If only the raw data is required, "UInt",&KEY_uni,... should work. AHK strings are delimited by the first NUL.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: unicode
PostPosted: May 21st, 2009, 9:52 am 
hi

the simplest way to send unicode character if you know it is to send the alt code for it:

£ = Send,{Alt down}{Numpad0}{Numpad1}{Numpad6}{Numpad3}{Alt up}

:)


Report this post
Top
  
Reply with quote  
 Post subject: Re: unicode
PostPosted: May 21st, 2009, 11:47 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
csicky, AutoHotkey has built-in syntax for that:
Code:
Send {ASC 00163}
However, it doesn't work for unicode in all cases.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: bbwht, Cerberus, Exabot [Bot], MSN [Bot] and 29 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