I might do something like this:
Code: Select all
q:: ;replace characters (strip accents)
vText := "AĞŞAMÇAçaÜüiIöÖ"
vList := "Çc,çc,İi,ıi,Şs,şs,Ğg,ğg,Öo,öo,Üu,üu"
StringCaseSense, On
Loop Parse, vList, % ","
{
vChar1 := SubStr(A_LoopField, 1, 1)
vChar2 := SubStr(A_LoopField, 2, 1)
vText := StrReplace(vText, StrUpper(vChar1), StrUpper(vChar2))
vText := StrReplace(vText, StrLower(vChar1), StrLower(vChar2))
}
MsgBox, % vText
return
;commands as functions (AHK v2 functions for AHK v1) - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=37&t=29689
StrLower(String, T:="")
{
local OutputVar := ""
StringLower, OutputVar, String, % T
return OutputVar
}
StrUpper(String, T:="")
{
local OutputVar := ""
StringUpper, OutputVar, String, % T
return OutputVar
}
Btw watch out that for keys regarded as identical (e.g. Latin alphabet, case insensitive), later keys overwrite earlier keys.
Code: Select all
oMap := {a:1, A:2}
MsgBox, % oMap.Count() ;1
MsgBox, % oMap.a ;2
MsgBox, % oMap.A ;2