• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems escaping XML with Apache Commons StringEscapeUtils  RSS feed

Rob Marshall
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I've been trying to use the Apache commons StringEscapeUtils.escapeXml() to escape a string so that I can send it as an XML formatted request. The problem is that the characters between 128 and 255 all end up looking like: '�' in the escaped string. And since the string is supposed to be a filename, and that's "meaningless" in this context, the files end up not being found. In Python I use:

to escape the string, including quotes and apostrophes, but I can't seem to find a similar set of "utilities" for Java. Is there one?

Or is the problem simply a matter of character encoding?


It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!