Unicode and Triggers Topic is solved

Report problems with documented functionality
Juarj2022
Posts: 1
Joined: 21 May 2022, 05:36

Unicode and Triggers

Post by Juarj2022 » 21 May 2022, 05:47

Consider the following trigger

Code: Select all

:*?:🐟1::
Send, fishy
where we are using a character located in a higher plane (not the default Unicode plane), where there are two official encodings: one requiring a single Unicode-32 hexadecimal number (U+1F41F) or two smaller Unicode-16 hexadecimal numbers (0xD83D 0xDC1F). When I have the string,

Code: Select all

ddg🐟1
and run the above trigger, I will get the result

Code: Select all

ddfishy
that is, the replacement algorithm removed two characters (the fish and the g before) since it read the character as a two character Unicode, but it somehow is encoded in fact as a single character. Obviously, there is a simple workaround and that is not to use such characters.

lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: Unicode and Triggers

Post by lexikos » 21 May 2022, 18:15

How and why do you even use that as a trigger?

It is not "encoded as a single character". It is a single character, encoded as two UTF-16 code units. Hotstring replacement works by sending backspace, and pressing backspace once deletes the entire character regardless of how it is encoded. In some programs the behaviour of backspace might not even match what a hotstring expects for normal ASCII (e.g. backspace deleting multiple spaces).

This will fix it.

lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: Unicode and Triggers  Topic is solved

Post by lexikos » 04 Jun 2022, 22:09

Fixed by v1.1.34.03.

Post Reply

Return to “Bug Reports”