Jump to content

Xpath Error with XML containing umlauts


zyklotrop
 Share

This topic is 4394 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hi,

I'm trying to use the XPath function of Scriptmaster, but ran into a problem when the XML string does contain umlauts or higher ASCII characters. Even declaring the XML string as <?xml version="1.0" encoding="UTF-8"?> makes no difference. Only solution I have found is encoding the characters in unicode. Due to the fact that my XML string values can contain characters from different european languages extensive encoding and decoding would be necessary before and after the actual calculation. Is there a way to use the function with a UTF-8 character set?

Thanks for any response.

best

Martin

Link to comment
Share on other sites

  • Newbies

Hello clemhoff,

I'am sooo happy! This indeed does the trick. Thank you very very much for your help. I was near to the point of creating translation tables with tons of Unicode strings. But this is far better.

best

Martin

Hello,

Change the line of the Gscript that refers to the input stream to:

inputStream = new ByteArrayInputStream( someXML.getBytes("UTF-8") )

This should do the trick.

Link to comment
Share on other sites

This topic is 4394 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.