I am writing a Service Manager that calls a Web API to get the values from various devices.
The api returns values that may have html encoded characters (e.g. “70& deg; F” ). I would like to decode the encoded characters so “70& deg; F” is displayed as “70° F”. I’m trying to do this in the device handler but I can’t seem to get it to work with “°”.
I am using:
def val = new XmlSlurper().parseText("& deg;")
However, the above works with other encoded characters like “& amp;” and “& gt;”.
NOTE: I added a space after the “&” (e.g. "& ") so that the values would not be decoded in this post.
Thanks.