AutoHotkey Community

It is currently May 27th, 2012, 2:46 am

All times are UTC [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 237 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15, 16  Next
Author Message
PostPosted: November 24th, 2009, 8:10 am 
Offline

Joined: November 30th, 2008, 1:51 pm
Posts: 73
@fasto
Unfortuntely, the slowness is due to UTF-8 <-> UTF-16 conversions. I tried to cache the conversion result of the haystack. Though it's much faster than the current approach, it's still much slower than ANSI version. The conversion is required because PCRE doesn't support UTF-16.

BTW, in the most cases there is no need to pass the huge data to RegEx*. In your example it can call RegExMatch one line at a time instead. It should give you acceptable performance (it should also run much faster in ANSI version, given larger data.).


Last edited by jackieku on November 24th, 2009, 5:50 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 24th, 2009, 5:41 pm 
Thx for sharing it.

In my case, Urldownloadtofile doesn't work.
Ansi version works well.
but, Unicode version doesn't work.
Always ErrorLevel is 1 and, not created a "downfile.htm" file.

Here is my test code.
Code:
urldownloadtofile, http://www.autohotkey.com/changelog/, downfile.htm
msgbox, ErrorLevel=%ErrorLevel%

I saved it with UTF16-LE BOM.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2009, 7:13 pm 
Offline

Joined: March 23rd, 2006, 2:20 pm
Posts: 128
Quote:
FileEncoding

Set the default encoding for FileRead, FileReadLine, Loop, Read, FileAppend, and FileOpen.
FileEncoding [CPnnn|UTF-8|UTF-8-RAW|UTF-16|UTF-16-RAW]


Quote:
FileAppend

An additional argument has been added to specify its encoding.
FileAppend [, Text, Filename, UTF-8|UTF-16|UTF-8-RAW]


In fact, for UTF-16 and a zero-length file, this add the byte order mark (BOM) - (FF FE) - and then the specified string as a plain (ANSI) text.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2009, 10:07 am 
Offline

Joined: November 30th, 2008, 1:51 pm
Posts: 73
rousni wrote:
In fact, for UTF-16 and a zero-length file, this add the byte order mark (BOM) - (FF FE) - and then the specified string as a plain (ANSI) text.

Thanks for your report. It is fixed.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2009, 10:07 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
Just one thing:
jackieku wrote:
NOTE: VS2005 and later is required to compile this. The C runtime bundled with VS2003 doesn't have Unicode stream translation layer. (see the doc of fopen() at MSDN)


Isn't that no longer valid as we moved to the TextStream classes?

I'm also thinking about hacking PCRE to handle TCHARs instead of UTF-8 through chars.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 29th, 2009, 2:15 am 
Offline

Joined: November 30th, 2008, 1:51 pm
Posts: 73
I upload a new version including the AutoHotkeySC.bin.
This version also comes with XDebug supports.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 29th, 2009, 4:30 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
I'm tinkering with the debugger and I've made some fixes.
As converting the variable contents from/to UTF-8 is hugely slow I've decided to add a build option to AutoHotkeyU that sends the variable contents directly in UTF-16. I've also updated XDebugClient to support this change.
Speaking of changes, the StrGet() function has been modified to accept a new optional parameter that specifies the encoding of the string (0=TCHAR, 1=UTF-8 for now).

PD: Yes, I'm thinking about porting my SciTE debugger to AutoHotkeyU :D

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 29th, 2009, 8:52 pm 
Offline

Joined: March 23rd, 2006, 2:20 pm
Posts: 128
Quote:
I upload a new version including the AutoHotkeySC.bin.


Thank you :D :D :D

No need to replace the ANSI AutoHotkeySC.bin in its folder

Code:
SetWorkingDir D:\Program Files\AutoHotkeyU\Compiler
RunWait, D:\Program Files\AutoHotkeyU\Compiler\Ahk2Exe.exe /in "%A_ScriptDir%\VESTI.AHK" /out "%A_ScriptDir%\VESTI.EXE" /icon "%A_ScriptDir%\ICON.ICO" /pass "00000000000000000000000000000"


With the parameter /NoDecompile there is a problem:
"Could not extract script from EXE."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 30th, 2009, 9:45 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
rousni wrote:
With the parameter /NoDecompile there is a problem:
"Could not extract script from EXE."


Ahk2Exe and AutoHotkey use black magic to implement /NoDecompile. The public version of the source code doesn't include that black magic.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject: nothing
PostPosted: December 2nd, 2009, 2:52 am 
it worked !
but when it complied it turn into ASCII


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2009, 8:40 am 
Offline

Joined: March 23rd, 2006, 2:20 pm
Posts: 128
Quote:
when it complied it turn into ASCII

not for me:

everything is ok here
всичко е наред тук
Tout va bien ici
totul este ok aici
все ОК здесь
όλα είναι εντάξει εδώ
הכל בסדר כאן
كل شيء على ما يرام هنا
这里一切正常
sve je u redu ovdje
alles in Ordnung ist hier
모든게 괜찮다


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: nothing
PostPosted: December 2nd, 2009, 8:48 am 
Offline

Joined: November 30th, 2008, 1:51 pm
Posts: 73
UorME wrote:
it worked !
but when it complied it turn into ASCII

The script must be saved in UTF-8 ...
This is the *only* encoding supported by the compiled version.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 8th, 2009, 6:40 am 
Offline

Joined: March 25th, 2009, 2:04 pm
Posts: 24
Good job!

One suggestion: a tutorial or example will be perferable for our common users.

Thanks for your work!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2009, 6:00 pm 
Offline

Joined: February 11th, 2009, 2:23 pm
Posts: 142
Location: India
this is really great!

but the only problem i've is that the auto completion doesn't work if i change my keyboard;s layout using this.

for example
earlier
suppose there was something like this

Code:
::an::•◘♣
<using the Send {U+@#$#$} kinda thing>

now i configure to change the keyboard layout using your script
Code:
::a::•
::n::◘

now when i want
Code:
::an::•◘♣

this doesn't replace!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2009, 6:01 pm 
Offline

Joined: February 11th, 2009, 2:23 pm
Posts: 142
Location: India
by the way, I want to thank you from the bottom of my heart-
this is very very useful script! now i changed my entire keyboard to unicode Indian langauge with out trouble :D

God bless you and I pray for your long & Happy life!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 237 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15, 16  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Yahoo [Bot] and 7 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