KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: [Solved] Sending a Unicode character: What am I doing wrong?
Topic Summary: TL;DR let an external program handle it
Created On: 03/11/2019 12:13 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 [Solved] Sending a Unicode character: What am I doing wrong?   - locution - 03/11/2019 12:13 PM  
 Sending a Unicode character: What am I doing wrong?   - Alan Cantor - 03/11/2019 12:39 PM  
 Sending a Unicode character: What am I doing wrong?   - locution - 03/11/2019 01:14 PM  
 Sending a Unicode character: What am I doing wrong?   - locution - 03/11/2019 02:47 PM  
 Sending a Unicode character: What am I doing wrong?   - PG LTU - 03/11/2019 06:44 PM  
 Sending a Unicode character: What am I doing wrong?   - locution - 03/12/2019 02:08 AM  
 Sending a Unicode character: What am I doing wrong?   - monkey8 - 03/17/2019 01:47 PM  
 Sending a Unicode character: What am I doing wrong?   - Edgar - 03/18/2019 11:38 AM  
 Sending a Unicode character: What am I doing wrong?   - locution - 03/20/2019 06:40 PM  
 Sending a Unicode character: What am I doing wrong?   - locution - 03/23/2019 04:45 AM  
 [Solved] Sending a Unicode character: What am I doing wrong?   - David.P - 12/17/2021 10:24 AM  
 [Solved] Sending a Unicode character: What am I doing wrong?   - Ag - 02/21/2022 05:11 PM  
Keyword
 03/11/2019 12:13 PM
User is offline View Users Profile Print this message

Author Icon
locution
Senior Member

Posts: 124
Joined: 02/27/2019

 

Howdy there,

I've looked at several threads about how to send Unicode characters Dragon scripts, but for some reason that I tried so far doesn't seem to work. Could someone please tell he what I'm doing wrong?

Many thanks!

The character I want: this arrow: →

Link to the character: U+2192

What I tried:

Sub Main
SendKeys "DLE "
Rem SendSystemKeys ChrW(2192)
Rem SendSystemKeys ChrW(8594)
SendSystemKeys "{Alt+2192}"
End Sub




 03/11/2019 12:39 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4532
Joined: 12/08/2007

You can insert the right arrow symbol as part of an "Auto-Text" macro.
 03/11/2019 01:14 PM
User is offline View Users Profile Print this message

Author Icon
locution
Senior Member

Posts: 124
Joined: 02/27/2019

@Alan Thank you for your reply. When I do that, the arrow saves properly in the command window, but when I trigger the command, Dragon sends a question mark (U+003F).

The question mark is not just how my editor displays an unknown character, but it is the character that it receives (I know this because EditPad lets me see the code point for each character). I can change the encoding at will but will not get the desired character because the proper code point is not there.

Does it work on your side?

(If anyone else is reading, for future reference, would also like to know how to send the character via scripting.)

 03/11/2019 02:47 PM
User is offline View Users Profile Print this message

Author Icon
locution
Senior Member

Posts: 124
Joined: 02/27/2019

In the meantime, this is my workaround, but it makes no sense that it should be so complex.

1. Dragon script sends a key combination
Sub Main
Rem send Ctrl + Alt + Shift + K and let AutoHotkey handle it
SendSystemKeys "{Ctrl+Alt+Shift+k}"
End Sub

 

2. AutoHotkey processes the key and sends the text

^!+k:: ; ctrl alt shift k to send DLE →
Send, DLE →{Space}
return

 

Temporary conclusions

The fact that the text appears correctly when it is sent by AutoHotkey but not when it is sent by Dragon suggests that there is a problem in how Dragon sends Unicode.

But I am new to Dragon and would love to hear the take of the experts here!!! I still think that I must be doing something wrong.

 03/11/2019 06:44 PM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2248
Joined: 03/21/2007

I seem to recall that the basic used by Dragon only goes up to 256? characters (UTF8?) in string conversion so maybe that has something to do with it. Of course it is easy to script a command to do it. You don't need AHK to hold the alt key down while pressing several numpad numbers (Dragon calls them "{Pad0..9}") but 2192 gives: É and 8594 gives: Æ so not sure about your .

Anyway why? You can paste the  symbol into the vocab editor and give it a spoken form ("Unicode right arrow" works for me) and then just say "Unicode right arrow" when you want to put in a "" while speaking fluidly (no pauses needed).

 

EDIT:  Interesting.  While speaking and dictating into the quick reply box the correct character → shows up. But on posting, they alll got converted to "?" so I had to paste it back in.

Hth,



-------------------------




PG





Remember folks, my comments and this forum are for entertainment value only, please, no wagering or other reliance on the contents herein.  I permit no commercial use of my ideas (whether expressions or embodiments) without my written consent.



 03/12/2019 02:08 AM
User is offline View Users Profile Print this message

Author Icon
locution
Senior Member

Posts: 124
Joined: 02/27/2019

> But on posting, they alll got converted to "?" so I had to paste it back in.

Yep, I've tried to all that stuff but having managed to make it work. I'm sure there's a better way to do it than my current solution, but not finding what it is. Looking forward to any insights.
 03/17/2019 01:47 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 4173
Joined: 01/14/2008

You can't send Unicode characters with SendKeys but you can use the clipboard like so with advanced scripting or KB.

 

Sub Main

Clipboard ChrW(&h2192)

SendKeys"^v"

End Sub

 

 →

 

In the next release of KB I will make it so you will be able to send Unicode characters by using SendKeys. "SendKeys ChrW(&h2192)" will likely give you a ? until then. Can't do anything about advanced scripting because that is under the control of Dragon.

 

 

→→→→

 

 



-------------------------



 03/18/2019 11:38 AM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1375
Joined: 04/03/2009

Originally posted by: monkey8 use the clipboard

 

you will be able to send Unicode characters

Fantastic! Not only a current workaround but a fix for the next version of KnowBrainer. Thanks!



-------------------------

-Edgar
DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Office 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card with 3 1920x1080 monitors

 03/20/2019 06:40 PM
User is offline View Users Profile Print this message

Author Icon
locution
Senior Member

Posts: 124
Joined: 02/27/2019

Thank you for the working answer @monkey8

Obviously not your fault, but wow, the lack of Unicode support out of the box in Dragon NaturallySpeaking is really underwhelming.

 03/23/2019 04:45 AM
User is offline View Users Profile Print this message

Author Icon
locution
Senior Member

Posts: 124
Joined: 02/27/2019

For any other newbies on the same track, here is a variation that doesn't lose the contents of the clipboard.

 

Sub Main
Dim my_clipboard As String
my_clipboard = Clipboard$()
Wait 0.1
Clipboard ChrW(&h2192)
SendKeys "^v"
Wait 0.1
Clipboard my_clipboard
End Sub

 12/17/2021 10:24 AM
User is offline View Users Profile Print this message

Author Icon
David.P
Top-Tier Member

Posts: 645
Joined: 10/05/2006

FWIW, I seem to get varying mileage when trying to dictate Unicode text.

For example, I can easily dictate a certain Unicode colon, which I simply have assigned as a spoken form to a custom word named "Unicode colon"?

However, it does not work with this Unicode question mark ?

When I save this as a spoken form and dictate it, it creates a normal question mark ? instead.

 

Unfortunately, like almost everything else regarding the formatting of postings, Unicode does not work in this forum software which dates from the stone age, so the Unicode characters above all appear as normal question marks.



-------------------------

Sennheiser MKH Mic
Visual & Acoustic Feedback + Automatic Mic Control



 02/21/2022 05:11 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 1035
Joined: 07/08/2019

In case anyone cares, I have a Dragon command "UNICODE " that invokes one of my usual AutoHotKey scripts, which emits unicode characters corresponding to the unicode names, and various simplifications thereof.

e.g.

;; U+00AF MACRON (U+00AF) ¯ arial_unicode_ms
global.simple( { keys: "{U+00AF}", regex: "unicode (\x{00af}|MACRON)" } )

;; U+00B0 DEGREE SIGN (U+00B0) ° arial_unicode_ms
global.simple( { keys: "{U+00B0}", regex: "unicode (\x{00b0}|DEGREE SIGN)" } )

;; U+00B1 PLUS-MINUS SIGN (U+00B1) ± arial_unicode_ms
global.simple( { keys: "{U+00B1}", regex: "unicode (\x{00b1}|PLUS-MINUS SIGN|\+/-( sign)?|plus( or)?( (-|minus))( sign)?)" } )

A straightforward global edit of various unicode tables, To get the official names.

Plus idiosyncratic additions of my own more human friendly names.



-------------------------

DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design.

Statistics
32529 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 0 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 381 guests browsing this forum, which makes a total of 381 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2023 FuseTalk™ Inc. All rights reserved.