2

In the php section a similar problem was discussed. My problem has to do with either NotePad++ or either the AutoHotKey compiler. The Arabic text inside Notepad++ can by typed, saved and loaded correctly. When I compile with AutoHotKey and display the string containing the Arabic I typed with listvars, it shows a jumble of characters. Not just question marks like in the problem formulated at the php section, rather stuff like:
ط§ظ„ظ…ط¤ظ„ظپ
ںéè¢ں

Sometimes, some of the character are preserved, but slightly altered, sometimes it completely messes up.

In NotePad++ I experimented with some Arabic encoding settings under character settings. There are three settings in total, all of which scramble up my Arabic writing in NotePad++ These are:

  1. ISO 8859-6
  2. OEM 720
  3. WINDOWS 1256

Lastly, I can read Arabic correctly from the clipboard, save it to a txt file, read from it again and display it correctly.

Community
  • 1
  • 1
Khalil
  • 311
  • 5
  • 16

1 Answers1

1

For non-ASCII text within the script file to be interpreted correctly by AutoHotkey, one of the following must be true:

  1. The file is saved as UTF-8 with BOM. In Notepad++, the option is Encode in UTF-8.

  2. The file is saved as UTF-16 with BOM. In Notepad++, the Encode in UCS-2 Little Endian option works so long as the file does not contain supplementary characters (U+10000 to U+10FFFF).

  3. The file is saved with the system default ANSI codepage. This implies that the characters it contains are all within that codepage. In Notepad++, the option is Encode in ANSI. In Windows 7, the codepage is set by the Language for non-Unicode programs option in the Region and Language control panel.

  4. The file does not contain a BOM, but the /CPn command-line switch is used when running AutoHotkey.exe, where n is the identifier of the codepage used to save the file. See Code Page Identifiers at MSDN for a list.

UTF-8 is recommended.

Refer to Script File Codepage in the AutoHotkey documentation.

Lexikos
  • 987
  • 6
  • 16