• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sax parser error

 
Jay X Brown
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
sorry for the elementary level of my questions. i am trying out the sax parser and trying to handle the SAXParseException but, instead of getting the expected result, i'm getting this:
java.io.UnsupportedEncodingException
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(Compiled Code)
at java.io.UnsupportedEncodingException.<init>(Compiled Code)
at sun.io.CharToByteConverter.getConverter(Compiled Code)
at java.io.OutputStreamWriter.<init>(Compiled Code)
at echo4.main(Compiled Code)
what am i doing wrong?
thanks for your help.
jb
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your XML document here.
 
Jay X Brown
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is the xml document:
<?xml version='1.0' encoding='us-ascii'?>
<!-- The first xml document -->
<CustomerInfo
Source="Internal"
>
<username></username>
<emailid></emailid>
<name title="Ms.">
<LastName>Rai</LastName>
<FirstName>Aishwaria</FirstName>
</name>
<address type="shipping">
<streetleveldetail> 123 Rajdil Lane, Chowpatty</streetleveldetail>
<city>Mumbai</city>
<postalcode>22222</postalcode>
<countrycode>IN</countrycode>
</address>
<item/>
<item/>
</CustomerInfo>
the problem was solved when i changed the line in the parsing application from:
out = new OutputStreamWriter (System.out, "USASCII");
to
out = new OutputStreamWriter (System.out, "UTF8");
it's working but i'm totally confused on this encoding bit.
what am i missing?
jb
[This message has been edited by Jay Brown (edited February 07, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic