Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

UTF16 Chr() / Asc()


  • Please log in to reply
No replies to this topic
Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
The Unicode equivelant of Chr() and Asc().

Replaces the actual functions, so Unicode chars can be used without modifications to current scripts. Works with all mainstream editions of AHK, although the unicode features will not work on ANSI versions.

Chr(UnicodeCode)
{
 VarSetCapacity(TempVar,2), NumPut(UnicodeCode,TempVar,0,"UShort")
 Return, TempVar
}

Asc(UnicodeChar)
{
 Return, NumGet(UnicodeChar,0,A_IsUnicode ? "UShort" : "UChar")
}