LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unicode in Ring Control: bug?

Hello,

I am trying to display Unicode strings in Ring Controls. If I click on the right arrow to display the different items pertaining to the control it seems that Unicode=True is not taken into account. On the other hand if I select one of the items it displays correctly. 

Where could the problem come from?
Thank you very much

Christophe

 

 

Capture2.PNG

Capture1.PNG

  

0 Kudos
Message 1 of 18
(1,665 Views)

AFAIK, unicode is not officially supported. So, no bug.

0 Kudos
Message 2 of 18
(1,638 Views)

You could try setting the ring's text "Interpret As Unicode" property to true.

wiebeCARYA_0-1694003016667.png

 

0 Kudos
Message 3 of 18
(1,635 Views)

I know Unicode is not officially supported but most functions proposed in the AddOns library work quite well including (partially) this 'Update Ring Control' 😉

I have tried your suggestion with no improvement unfortunately... 😞 the drop-down items are not Uncodely displayed while they are well displayed when one is selected...

Capture3.PNG

0 Kudos
Message 4 of 18
(1,625 Views)

That was to be expected...

 

I'd stop looking and try a workaround. Or maybe try Strings and Values [] just to be sure, but I'd expect the same results.

 

You could try a combo box or even a right click menu (catch the mouse down? event to change a left click to a right click).

 

A major (and limited) workaround would be to not use unicode and work with a code page set to the language you're trying to support... 

0 Kudos
Message 5 of 18
(1,618 Views)

Use a Listbox to create your own drop-down menu if you can display Unicode in the Listbox correctly.

 

George Zou
0 Kudos
Message 6 of 18
(1,597 Views)

As Wiebe said, it's not technically a bug as it's an unsupported feature.

 

That said, it only affects characters with a integer value of less than 256 (which are mostly Latin characters). Here's a ring displaying both Latin and non-Latin character strings, and the non-Latin ones are largely OK.

Dataflow_G_0-1694008850323.png

 

What I suspect is happening is the text in the drop down is being parsed byte by byte, and as soon as a NULL (0x00) byte is found, the string is terminated. Problem is that in UTF-16LE encoding, every character value < 256 is a pair of bytes where the second byte is 0x00 (as you can see in the \ codes display of your test strings).

 

It is possible to render Latin looking text using homoglyph substitution, though this approach should never be used in practice for a wide variety of reasons (security, accessibility, missing glyphs in fonts, etc)

Dataflow_G_2-1694010649729.png

 

You're probably stuck with looking for an alternative to text rings. Perhaps pre-rendered unicode text in a picture ring, or showing and hiding a listbox control to act as the ring drop down selector.

0 Kudos
Message 7 of 18
(1,585 Views)

last time I tested (with tab controls), it was necassary to once "write" the unicode characters by copy and paste via mouse into the control or indicator.

after that, updating via property node was possible as usual.

 

 

front block
first-time.gif demo_first-time.png

 

 

 

 

Message 8 of 18
(1,570 Views)

wiebe@CARYA wrote:

You could try setting the ring's text "Interpret As Unicode" property to true.

wiebeCARYA_0-1694003016667.png

 


That property doesn't necessarily affect all text.  It's like the font properties in that it is applied only to the selected text.  Set the selection start and selection end before setting this property.

Message 9 of 18
(1,546 Views)

Here's a crazy workaround:

The Unicode characters starting at FF00.h (Halfwidth and Fullwidth Forms) are very similar to the ASCII characters starting at 0020.h.  So by adding an offset of FFE0.h you will have a UTF-16 string without any null bytes; and the dropdown box works OK.  See attachment.

Message 10 of 18
(1,536 Views)