• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need to add an invalid UTF-8 character

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 28138
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic