Input Unicode character
Input Unicode character
What is the best way to input a Unicode character with AHK?
Re: Input Unicode character
Code: Select all
InputBox, char, Character, Enter a character.,, 300, 125
MsgBox, %char%
Re: Input Unicode character
As this is an uncommon Unicode Char how do I tell AHK what it is?
Re: Input Unicode character
A faster way to an answer is to give the reader an example of the problem. What character is it?
Re: Input Unicode character
It will vary, but one would be U+014D - ō
Re: Input Unicode character
One way is to make a hotkey:
Make sure your script file is saved with “UTF-8 with BOM” encoding.
Code: Select all
+^o::Send, ō ; press Shift+Ctrl+o
Make sure your script file is saved with “UTF-8 with BOM” encoding.
Re: Input Unicode character
I am getting Å , not ō The square shows in NP++ as Black background RI
I added your line to a script that enters into notepad++
I added your line to a script that enters into notepad++
Re: Input Unicode character
Sorry, just saw this:
"Make sure your script file is saved with “UTF-8 with BOM” encoding."
Could you help me with that please?
"Make sure your script file is saved with “UTF-8 with BOM” encoding."
Could you help me with that please?
Re: Input Unicode character
I found UTF-8-BOM in NP++ , but it looks the same
Re: Input Unicode character
If I copy the char from Character Map it works fine.
However I was hoping to automate the process
However I was hoping to automate the process
Re: Input Unicode character
Close the script in your editor after saving it with the new encoding, then open it again, especially if you’re using a feature to run it directly from the editor.
Are you using the the ANSI or Unicode version of AHK? If you’re not sure, run the following script:
Are you using the the ANSI or Unicode version of AHK? If you’re not sure, run the following script:
Code: Select all
MsgBox, % A_IsUnicode ? "Unicode" : "ANSI"
Re: Input Unicode character
It worked here.
AHK version 1.1.36.01
AHK version 1.1.36.01
Re: Input Unicode character
It show unicode and my version 1.1.33.10
Re: Input Unicode character
A common misconception in Notepad++ is to use Encoding > UTF-8-BOM instead of Encoding > Convert to UTF-8-BOM. The first command changes only the display of the characters, while the second, the recommended for what you want to accomplish, changes the file.
Re: Input Unicode character
Still not right. I could try getting up to your version.
- Attachments
-
- NPchar.jpg (22.83 KiB) Viewed 749 times
-
- image.png (20.28 KiB) Viewed 749 times
Re: Input Unicode character
As I understand, new 2 is not saved to disk. Please, do it.
Edit: Also check this option: Settings > Preferences... > MISC. > Use DirectWrite (May improve rendering special characters, need to restart Notepad++)
Last edited by sofista on 03 Dec 2022, 10:37, edited 1 time in total.
Re: Input Unicode character
Saved, checked encoding, reloaded
- Attachments
-
- MacronO.jpg (26 KiB) Viewed 732 times
Re: Input Unicode character
It's possible that the AHK script file needs to be in that format (boiler has already noted).
Re: Input Unicode character
Yes, AHK doesn’t know or care what mode you are using to display it in your editor. The only thing that matters is that the script file is saved with that encoding.
Re: Input Unicode character
Thanx, much appreciated! That was the answer.
Sorry for the delay. Our internet went down. High winds & power losses around here.
This is a great help. All the best to you.
Sorry for the delay. Our internet went down. High winds & power losses around here.
This is a great help. All the best to you.