OH4 - Unicode characters in Item Textual Definition

  • Platform information:
    • Hardware: Raspberry Pi4 - 2GB
    • Java Runtime Environment: openjdk 17.0.7 2023-04-18
    • openHAB version: OH4

Greetings, I have finally taken the leap to OH4 and setting up my new device.

Is there a way to escape the Unicode characters when defining an item in the Textual definition? The syntax checker is having a complaint when it sees the \u2082 or other Unicode symbols.

I am taking the example from the Air Quality binding page: Air Quality - Bindings | openHAB

As you can see below, I am unable to save the items unless i remove the Unicode characters. Not a big deal, just wondering if there is a different way to do this, or if there is perhaps an update to the syntax checker that would mark this as acceptable.

Thank you!

You can try escaping the \.


You could also look up what those look like in the browser and copy/paste the “real” character into the label and see if that works. I know it works with stuff like “°F”.

1 Like

Thank you Rich!
The first suggestion to double escape did not help (but it did shut up the syntax checker and let me create the item)

However, your second solution did work.

Do you foresee any benefit in enhancing the syntax parser in Textual Definition to allow the escaped Unicode definitions inside of a description? i.e. \u2082 (or do you think this would be an overly complex change and low value?)

(Sidenote: I have been using file based config now as I am exploring with OH4) and the original values work fine in my files as expected:

I’ve no idea. I don’t really know anything about the implementation of the parses involved. I suspect it will at least hit MainUI but might also include openhab-core to support.