Skip to content

Commit

Permalink
bug fixes, about character sets
Browse files Browse the repository at this point in the history
1.convert \Triggers\Hotkey.ahk from ANSI to UTF-8

reason:
Fail to compile, Error: Missing close-quote

2.sets the temporary encoding for this line
FileRead, json, % LocalAppData "\Google\Chrome\User
Data\Default\Bookmarks" ;------ LoadChromeBookmarks(obj = "")
(CURLPlugin.ahk) ----
fix as:
oldFileEncoding := A_FileEncoding ;backup
FileEncoding, UTF-8
FileRead, json, % LocalAppData "\Google\Chrome\User
Data\Default\Bookmarks"
FileEncoding, %oldFileEncoding% ;restore

reason:
Error: Expected object value, got: 't' at position 132
chrome bookmarks encode in utf-8

all compile in win7 x86 32bit
  • Loading branch information
guangfjy committed Aug 4, 2014
1 parent 2c3f6d0 commit 5e1562f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Binary file added 7plus.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions Accessor/CURLPlugin.ahk
Expand Up @@ -162,7 +162,10 @@ Class CURLPlugin extends CAccessorPlugin
RegRead, LocalAppData, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders, Local AppData
if(FileExist(LocalAppData "\Google\Chrome\User Data\Default\Bookmarks"))
{
oldFileEncoding := A_FileEncoding ;backup
FileEncoding, UTF-8
FileRead, json, % LocalAppData "\Google\Chrome\User Data\Default\Bookmarks"
FileEncoding, %oldFileEncoding% ;restore
obj := lson(json)
;obj := JSON_load(LocalAppData "\Google\Chrome\User Data\Default\Bookmarks")
this.ChromeBookmarks := Array()
Expand Down
10 changes: 4 additions & 6 deletions Triggers/Hotkey.ahk
@@ -1,4 +1,4 @@
Class CHotkeyTrigger Extends CTrigger
Class CHotkeyTrigger Extends CTrigger
{
static Type := RegisterType(CHotkeyTrigger, "Hotkey")
static Category := RegisterCategory(CHotkeyTrigger, "Hotkeys")
Expand Down Expand Up @@ -330,9 +330,8 @@ Class CHotkeyTrigger Extends CTrigger
;Return to sender
return Abort = true
}

;Checks if a hotkey is not used internally by 7plus and may be used for a custom hotkey trigger
CollisionCheck(key1, filter1, exclude)
CollisionCheck(key1,filter1,exclude)
{
7PlusHotkeys := "#e,^i,^t,^Tab,^+Tab,^w"
if(key1 = exclude)
Expand All @@ -345,7 +344,7 @@ Class CHotkeyTrigger Extends CTrigger
key1_Right := InStr(key1, ">") > 0 || !InStr(key1, "<")
key1_WildCard := InStr(key1, "*") > 0
key1_stripped := RegExReplace(key1, "[\*\+\^#><!~]*")
Loop, parse, 7PlusHotkeys, `, ,%A_Space%
Loop, parse, 7PlusHotkeys, `,,%A_Space%
{
key2 := A_LoopField
key2_Win := InStr(key2, "#") > 0
Expand All @@ -356,7 +355,7 @@ Class CHotkeyTrigger Extends CTrigger
key2_Right := InStr(key2, ">") > 0 || !InStr(key2, "<")
key2_WildCard := InStr(key2, "*") > 0
key2_stripped := RegExReplace(key2, "[\*\+\^#><!~]*")
DirCollision:=((key1_Left = true && key1_Left = key2_Left) || (key1_Right = true && key1_Right = key2_Right))
DirCollision:=((key1_Left = true && key1_Left = key2_Left)||(key1_Right = true && key1_Right = key2_Right))
KeyCollision:=(key1_stripped = key2_stripped)
StateCollision:=((key1_Win = key2_Win && key1_Alt = key2_Alt && key1_Control = key2_Control && key1_Shift = key2_Shift) || key1_WildCard || key2_WildCard)
if(KeyCollision && StateCollision && DirCollision)
Expand All @@ -365,7 +364,6 @@ Class CHotkeyTrigger Extends CTrigger
return false
}
}

HotkeyGUI_UpdateHotkey:
GetCurrentSubEvent().GuiShow("", "UpdateHotkey")
return
Expand Down

0 comments on commit 5e1562f

Please sign in to comment.