• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Need to add an invalid UTF-8 character

 
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
 
Marshal
Posts: 24594
55
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!