How to send SMP characters to Notepad++? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

How to send SMP characters to Notepad++?

23 May 2018, 09:41

I defined some hotstrings containing characters from the Unicode Supplemental Multilingual Plane (SMP). Those work nicely (thanks to trismarck's UTF-16 surrogate tip in some applications, but unfortunately not in Notepad++. There, the following code

Code: Select all

SendMode Input  ; It doesn't help to use Event or Play.
#SingleInstance force

; Display bike 
MsgBox, % chr(0xD83D)chr(0xDEB2)

#Hotstring b0 r
::bike0::x ; <-- the "x" stands for the bike character, which is unsupported in this forum. 
#Hotstring b0 r0
::bike1::{U+1F6B2}
::bike2::{U+D83D}{U+DEB2}

#b::Send, {U+D83D}{U+DEB2}
creates the following output after entering "bike0 bike1 bike2 #b":

Code: Select all

bike0 ߚҍ bike1 ⒶⒷ bike2 ⒶⒷ ⒶⒷ
, where Ⓐ and Ⓑ stand for {U+D83D}{U+DC00} and{U+DAB2}{U+DC00}, respectively. (I only had to replace the characters here since they are not supported in this forum.) In other words, bike1 and bike2 seem to insert the four surrogates {U+D83D}{U+DC00}{U+DAB2}{U+DC00}, rather than just the two that are defined. This appears to be caused by Issue #801: UNICODE-support broken for characters outside the BMP. Is there a way around it? The funny thing is that Notepad++ can do a lot with SMP characters: The bike that I pasted per clipboard after ::bike0:: displays nicely and stays when I save and reopen the file.
Last edited by Micromegas on 23 May 2018, 13:09, edited 1 time in total.
User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

Re: How to send SMP characters to Notepad++?  Topic is solved

23 May 2018, 09:48

Found a workaround:

Code: Select all

#c::
	clipboard := bike
	Send ^v
	Return
Three minutes away from the keyboard work wonders!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: wilkster and 319 guests