Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need to add an invalid UTF-8 character  RSS feed

 
Raghu Narayanan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am testing my code using SAX Parser. I need to generate a XML file which has an invalid UTF-8 character. Thus it should fail Parsing as the encoding in the file is UTF-8 on the XML prolog statement. At the same time if I use ISO-8859-1 as the encoding scheme in the prolog it should succeed.

My problem is generating a invalid UTF-8 character using a java client code.
using char from 160 to 255 which is essentially iso characters does not help as 160 is represented as A0.

if anyone has done somethign similar, need your help
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to generate a malformed XML document?

Sure, that's no problem.

That writes out a document which claims that its encoding is UTF-8, but really it's ISO-8859-1.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!