• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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: 27214
87
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.
 
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic