Yes I added that after posting (and yes of course, restarted OH/Java), but unfortunately it did not change anything. Is it really “UTF-8” ? Read “utf8” somewhere, too.
Not sure, but WIndows has it set to UTF-8 (Without the quotes if that makes any difference) by default in setenv.bat as a result of a fix for Windows users getting the same issue.
I played with this before when helping @RRoe migrate lucid back into the openhab Scripters repo, which you’ll see in ideAlarm. I am getting an error using this right now, but I’m not sure if that is due to my version of Jython (2.7.0) or an issue with my Jython bundle. BTW, I have gotten errors using 2.7.1 and 2.7.2b2 due to this bug. In Python 3 (look for GraalVM in OH3), the default is UTF-8.
When you are using special characters, you need a unicode string. I’ll add an entry for unicode strings in the But How Do I section of the HL docs. This will be probably be one of the trickiest bits for noobs to understand, using scripted automation. Using English, you don’t run into this often, except for QuantityTypes, e.g…
When writing your rules, if a variable could possibly contain special characters, like Item names, Item labels, QuantityTypes, etc., and it is used in a string, use unicode!