Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use UTF-8 in AutoHotKey?

Tags:

autohotkey

I am trying to make two hyphens trigger a short dash, and three hyphens trigger a long dash; like

:*?:---=::— :*?:--=::– 

except working. Here is where I have gotten to:

:*?:11::  SendLevel 1  Send 2  return  SendLevel 0  :*?:21::3 

this works (11 produces 2, 111 produces 3)

:*?:--::  SendLevel 1  Send –  return  SendLevel 0  :*?:–-::— 

This is the same script, but ‘1’ has been replaced by ‘-’, ‘2’ has been replaced by ‘–’, and ‘3’ has been replaced by ‘—’—“--” should produce “–” and “---” should produce “—”, but it doesn't work because Unicode is not fully supported in the version I am using (AutoHotKey_L v1.1.09.04 from autohotkey.com).

like image 793
Eamon Moloney Avatar asked Mar 26 '13 11:03

Eamon Moloney


People also ask

What characters does UTF-8 include?

UTF-8 supports any unicode character, which pragmatically means any natural language (Coptic, Sinhala, Phonecian, Cherokee etc), as well as many non-spoken languages (Music notation, mathematical symbols, APL).

What is a UTF-8 multibyte character?

UTF-8 is a multibyte encoding able to encode the whole Unicode charset. An encoded character takes between 1 and 4 bytes. UTF-8 encoding supports longer byte sequences, up to 6 bytes, but the biggest code point of Unicode 6.0 (U+10FFFF) only takes 4 bytes.


1 Answers

The .ahk text file needed to be saved with UTF8-BOM encoding rather than UTF8

As pointed out in this comment, posting as an answer for more visibility.

like image 72
2 revs Avatar answered Sep 23 '22 23:09

2 revs