Issues with character encoding

Hi All,

Hope this post finds u all in good spirits.

We’ve written a Java service to encode the contents of our input message. The issue we face is that for some characters we don’t get the desired output after encoding. One example is:

® character gets converted to “& r e g ;” instead of “& # 1 7 4 ;” (I’ve put spaces in between characters as these values will be displayed as ® only while posting; so please ignore the whitespaces)

The Java service that we’re using uses the StringEscapeUtils.escapeHtml(str) service for encoding.

Can anyone please suggest what’s going wrong here, or if you know the exact solution?

Thanks & Regards

Can you please upload your entire JS in this thread and so users can take a look and respond?

PS: use attachment

Also how is the data getting passed to the inputs of JS?


Hi All,

I got the solution to my problem.

I replaced the StringEscapeUtils.escapeHtml(str) method call with StringEscapeUtils.escapeXml(StringEscapeUtils.unescapeHtml(str))


Glad to hear you resolved it self:)