Invalid byte 2 of 3-byte UTF-8 sequence.

Hi All
I have to read a xml file from a given URL, which consists some french characters in it. I am getting
IOException :Invalid byte 2 of 3-byte UTF-8 sequence Exception.
The code i am using is.
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(new URL(url));
Thanks in Advance
Amit Srivastava

The original XML may have been coded in UTF-16, but then you have this code:xml.trim().getBytes()which says
"Take that XML string and convert it to bytes, using my system's default encoding."
The parser then attempts to parse those bytes, which are encoded in ISO-8859-1 or windows-1252 or some such. Since you didn't declare this fact in the XML's header, the parser assumes the bytes are encoded in UTF-8. When it comes to a sequence of bytes in the code that aren't valid UTF-8 encodings of anything then it complains.
If you really have to convert the input to bytes then try this:xml.trim().getBytes("UTF-8")

Similar Messages

  • Java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.

    Hi,
    I see the below error when I try to import bunch of email templates.
    com.waveset.util.WavesetException: ==> java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.
    Can any one explain me why is this happenining?
    Thanks,
    Siddiqui

    Hi Siddiqui,
    It looks like u r importing some characters those are not valid UTF-8 character set and some time this type of error comes when u try to import characters like *<,>* so use *& lt;* for < and *>* for >.
    sorry those Characters r not display properly :-(
    Thanx
    Shant
    Edited by: Shant on Jan 18, 2008 6:19 AM
    Edited by: Shant on Jan 18, 2008 6:23 AM

  • "Invalid byte 1 of 1-byte UTF-8 sequence" exception trying to display image

    Hi there!
    Last night I updated my project to open the <wellcome-file>. So I put this in my web.xml file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        id="WebApp_ID"
        version="2.5">
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.jspx</param-value>
    </context-param>
    <welcome-file-list>
        <welcome-file>faces/login.jspx</welcome-file>
    </welcome-file-list>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    [...]Now when I type http://localhost:8080/myproject the login.jspx is opened as expected.
    But after this change, exceptions started to shown when images from my template.jspx is loaded (?).
    Here's a piece of my template.jspx:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <jsp:root
         xmlns:jsp="http://java.sun.com/JSP/Page"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:r="http://richfaces.org/rich"
         xmlns:a4j="http://richfaces.org/a4j"
         version="2.0">
    <f:facet name="controls">
         <h:panelGroup>
              <h:graphicImage
                   value="../imagens/erro.png"
                   id="hidelink" />
         </h:panelGroup>
    </f:facet>
    [...]And here is the exception:
    SEVERE: Error Rendering View[/imagens/erro.png]
    com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
         at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.arrangeCapacity(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipString(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    [...]And, of course, the image is not displayed.
    The images from pages that uses template.jspx works fine (even the same image that causes the exception).
    Only images from my template.jspx and pages that I use with <ui:include> throws the exception.
    My directory structure:
    web
    |___templates
    |___imagens
    |___pages
    login.jspxI tried with ISO-8859-1 and UTF-8 as encoding and the problem is the same.
    I need some help. Any help.
    If any more info is needed, please just ask me.
    Thank you in advace!
    I'm using:
    JSF 1.2; Facelets 1.1.14; Richfaces 3.3; Tomcat 6, Java 6
    Yoshimit

    I got the same error. It was because my application's .java files were saved as UTF-8 but the .xhtml files were saved as cp1255 encoding. I have also added a filter to set the charset to each response like described [here |http://www.coderanch.com/t/211549/JSF/java/JSF-Character-Sets-UTF-mainly] .
    PS: I had another error after that which was caused by copying the Richfaces xmlns definitions from a PDf provided by Refcardz. The " symbol turend to something that the SAX parser could not process.
    Hope this helps.
    Pavel Myshkin

  • BaseRuntimeException:Invalid byte 1 of 1-byte UTF-8 sequence

    Hi experts,
    I am getting error in MONI as :
    Runtime exception occurred during application mapping com/sap/xi/tf/_MM_MES_TO_SAP_SHIPPING_REQ2_; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Invalid byte 1 of 1-byte UTF-8 sequence
    When i checked the payload i found :
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    An invalid character was found in text content. Error processing resource 'file:///C:/Documents and Settings/snayak/Local S...
            <ns0:SalesOrderInformation>
    But when I copy and paste the payload data from note pad and did testing in Messsage mapping, it became successful.
    It is not opening in xml format but it is working in notepad.
    Please advise what to do.
    Thanks,
    Swapnashree

    Hi,
    Stefan is correct. If you are unable to display it, then it is not a valid xml. Based on the error that you provided, the invalid character is located just above the <ns0:SalesOrderInformation>. So you should start from there.
    But when I copy and paste the payload data from note pad and did testing in Messsage mapping, it became successful.
    It is possible that you just selected a part of the payload and pasted it in the mapping, hence it was successful. Pasting the whole payload would more or less give the same error as what you have seen in moni.
    If you can have your input XML validated by XML programs such as XMLSpy or XMLStudio, it would greatly help in troubleshooting your issue.
    Hope this helps,
    Mark

  • Error: Invalid byte 2 of 3-byte UTF-8 sequence

    Hi Experts,
      We have a synchronous scenario from Websphere to PI, where once Websphere sends the request it is been executed by ABAP proxy and gives response with some special characters. But as the xml coding is in UTF-8 only, this is not throwing error in Response Mapping.
      But when it reaches the end system, it is giving this "Invalid byte 2 of 3-byte UTF-8 sequence." " error saying that enocoding to UTF-8 is not done correctly. How can I overcome this situtation. please suggest.
    Thanks,
    Anudeep

    Hi,
    Check the encoding to be used for the data..or else check whether the RFC connections used are set to unicode...
    if possible execute the request in SAP and check what is the output it is generating...if it is proper over there then you need to identify the encoding to be used when it comes to PI..
    HTH
    Rajesh

  • Invalid byte 2 of 2-byte UTF-8 sequence

    Hi everyone.
    I am trying to schedule a BI Publisher report using the PublicReportService web service.
    When I call the web service, I get the following error
    Invalid byte 2 of 2-byte UTF-8 sequence.
    I think the cause of the error is that one of the parameters has special characters (Ñ). Please look at the parameters section of the XML
    <parameterNameValues>
    <item>
    <name>P_CDEMPCSC</name>
    <multiValuesAllowed>false</multiValuesAllowed>
    <values>
    <string>15</string>
    </values>
    </item>
    <item>
    <name>P_CDPERMES</name>
    <multiValuesAllowed>false</multiValuesAllowed>
    <values>
    <string>01062011</string>
    </values>
    </item>
    <item>
    <name>P_DSEMPCSC</name>
    <multiValuesAllowed>false</multiValuesAllowed>
    <values>
    _<string>DISEÑO Y CONSTRUCCION</string>_
    </values>
    </item>
    </parameterNameValues>
    ¿Am I right about tha cause of the error?
    ¿How could I fix it? There is not an option for me to substitute the Ñ.
    Thans in advance

    Hi again.
    I've found the solution to this issue
    1.- The XML needs this line at the beginning
    '<?xml version="1.0" encoding="ISO-8859-1" ?>'
    If not, it is encoded by default as UTF-8, and apparently that's why some special characters like Ñ and é produce the error
    2.- In case of some parameter has an &, this character needs to be replaced by the expression &amp;.
    Bye.

  • ASDOC error : Invalid byte 2 of 3-byte UTF-8 sequence

    Hi everyone,
    I'm trying to use ASDOC and have some problems.
    1) The first and most anoying one is that I don't have the
    complete documentation generated for MXML files : the files appear
    in the documentation, but the description is empty. I however
    commented them correctly using /** */ in the <mx:Script> tag,
    but none of my methods appear... I just see the Events when
    declared as class metadata.
    2) I'm using Eric Feminella's ASDocAntTask and I experience a
    strange error message : Impossible to open the document, Invalid
    byte 2 of 3-byte UTF-8 sequence. It happens for a whole bunch of
    files in the asdoc/templates directory, including the
    asdoc-util.xsl file. Maybe this is the reason why point 1) appears
    3) The Index html files are not generated... Consequence of
    point 2) I guess
    4) I have a warning message (oddly appearing 4 times) : CSS
    type selectors are not supported in components. I know it's not
    possible to have a link to my CSS file in components. But my file
    declaration is in the <mx:Application> class...
    Thanks for your help, all these errors really put me in
    trouble as I must deliver the documentation soon...
    Thanks
    Edit : the complete list of files impossible to read is the
    following :
    asdoc-util.xsl
    package.xsl
    all-index.xsl
    class-list.xsl
    package-detail.xsl
    class-files.xsl
    Ben

    Hi again !
    I finally found how to (partially) solve my problem !
    In ASDocAntTask, there are two files the user has to fill in
    : the build.xml file and a properties file. In the properties file,
    you define, for example, the name that you want to appear in the
    browser window... And as my project is French, I used a French
    special character é... which messed everything up...
    So finally, I got rid of this problem and solved points 2)
    and 3)
    I have now a great documentation, but still nothing about
    mxml files !
    How can I solve this problem ?

  • Org.dom4j.DocumentException: Invalid byte 1 of 1-byte UTF-8 sequence. Neste

    Hi there,
    I'm getting following exception, when i try to parse xml containing french character like
    la valeur utilisée pour le paramètre ROWS est passée de 10000 à 5418*
    org.dom4j.DocumentException: Invalid byte 1 of 1-byte UTF-8 sequence. Nested exception: Invalid byte 1 of 1-byte UTF-8 sequence.
         at org.dom4j.io.SAXReader.read(SAXReader.java:353)
         at org.dom4j.io.SAXReader.read(SAXReader.java:264)
         at com.azure.sparkcommon.XMLHelper.loadDocument(XMLHelper.java:57)
         at com.test.Sample.main(Sample.java:41)
    Nested exception:
    java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.
         at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown Source)
         at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
         at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
         at org.apache.xerces.impl.XMLEntityScanner.scanLiteral(Unknown Source)
         at org.apache.xerces.impl.XMLScanner.scanAttributeValue(Unknown Source)
         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source)
         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
         at org.dom4j.io.SAXReader.read(SAXReader.java:334)
         at org.dom4j.io.SAXReader.read(SAXReader.java:264)
         at com.azure.sparkcommon.XMLHelper.loadDocument(XMLHelper.java:57)
         at com.test.Sample.main(Sample.java:41)
    Nested exception: java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.
         at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown Source)
         at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
         at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
         at org.apache.xerces.impl.XMLEntityScanner.scanLiteral(Unknown Source)
         at org.apache.xerces.impl.XMLScanner.scanAttributeValue(Unknown Source)
         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source)
         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
         at org.dom4j.io.SAXReader.read(SAXReader.java:334)
         at org.dom4j.io.SAXReader.read(SAXReader.java:264)
         at com.test.XMLHelper.loadDocument(XMLHelper.java:57)
         at com.test.Sample.main(Sample.java:41)
    Can any body help me out.
    Thanks,
    S

    Hey...
    I got the solution..... it's all because of charset UTF-8 used in xml doctype/CharEncoding, As my JVM is running on OS for French locale i need to make use of 'ISO-8859-1' as CharEncoding.
    This resolved my problem.
    Anyways thanks.
    Sid
    Edited by: hiremath47 on May 20, 2010 5:48 PM

  • Invalid byte 1 of 1 byte utf 8 sequence(BI Mobile 4.0)

    hi..
    i want to try open a report from my ipad..
    in the report the only prompt is the day.
    but when i try the refresh report i see "invalid byte 1 of 1 byte utf 8 sequence"
    so i cant refresh report..
    what can i do..
    thanks in advance.

    The problem is in the file format. I do not know exact solution for this since I'm not familiar with BI Mobile 4.0. The report you try to open is really not in UTF-8 format. I would quess it is in ISO-8859-1 or similar format so you need to change this into the UTF-8 format somehow.
    Edited by: Mika Karvonen on Sep 15, 2011 2:27 PM

  • Invalid byte 2 of 3-byte UTF-8 sequence error

    I'm writing a java program that accesses an XML file and do some computation on it. The problem is that the program works on small sample XML files, but when trying to work with big XML files (which was generated by other program) I get "Invalid byte 2 of 3-byte UTF-8 sequence" parsing error. Any tips?

    Hi,
    Check the encoding to be used for the data..or else check whether the RFC connections used are set to unicode...
    if possible execute the request in SAP and check what is the output it is generating...if it is proper over there then you need to identify the encoding to be used when it comes to PI..
    HTH
    Rajesh

  • Invalid byte 1 of 1-byte UTF-8 sequence

    Hello all,
    I get an xml string say (xmlString)from a SQL server DB, to which I do
    1)
    byte[] barray = xmlResults.getBytes("UTF8");
    xmlResults = new String(barray, "UTF8");
    2)
    xmlresults = <?xml version=\"1.0\" encoding=\"UTF-8\"?><reports>" + xmlResults + "</reports>
    3)Then write the string contents to a file
    FileWriter fw = new FileWriter("C:\\Tomcat 4.1\\webapps\\alertLine\\DataExtraction\\xml\\" + test.xml,true);
    System.out.println("filewriter encoding: " + fw.getEncoding());
    //output---filewriter encoding: Cp1252
    PrintWriter outl = new PrintWriter(new BufferedWriter(fw));
    outl.print(xmlResults);
    4)Then do this...
    InputStream fileStream = null;
    try {
    fileStream = new FileInputStream(xmlBase + text.xml);
    } catch (FileNotFoundException e) {
    e.printStackTrace();
    InputSource inputSource = new InputSource(fileStream);
    DOMParser parser = new DOMParser();
    inputSource.setEncoding("UTF-8");
    try {
    parser.parse(inputSource);
    } catch (SAXException e) {
    e.printStackTrace();
    The paser.parse(inputSource) throws "java.io.UTFDataFormatException"
    How to fix this? Is this due to the encoding of the fileWriter?If so how can I set the encoding?

    Is this due to the encoding of the fileWriter?Yes, it is.
    If so how can I set the encoding?Short answer:Writer fw = new OutputStreamWriter(new FileOutputStream(fileName), "UTF-8");Long answer:
    Leave out step 1, it does nothing but waste time and space. You have a String and the end result is the same String.
    In step 3, don't use the "append" version of the writer. And if you are writing the XML to a file only so you can immediately read it back into your DOMParser, then don't write to a file at all. This is sufficient:InputSource inputSource = new InputSource(new StringReader(xmlresults));
    try {
      parser.parse(inputSource);
    } catch(SAXException e)
      // and so on...

  • Ignore invalid byte sequence

    I am reading in XML in my Java program using the Xerces library and am receiving an error "Invalid byte 2 of 2-byte UTF-8 sequence". It is caused because there is a two-byte sequence in the file "C2 3F" which is not a valid UTF-8 encoding. Is there any way to get the parser to ignore these invalid sequences? The XML files come from an external source so, aside from writing my own filtering routines to detect and fix errors like this, I cannot modify the content. Removing one or both of the bytes, or replacing them with valid characters, would work fine.

    FYI, this is the solution:
    private Reader prepareInputStreamReader(InputStream inputStream)
    // Strip all invalid UTF-8 sequences from input
    CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder();
    decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
    decoder.onMalformedInput(CodingErrorAction.REPLACE);
    decoder.replaceWith("?");
    return new InputStreamReader(inputStream, decoder);
    }

  • VIM Plugin VJDE, Ruby Error: invalid byte sequence in UTF-8

    Hello
    I'm trying to install the vim VJDE Plugin for java syntax highlighting.
    wget tarball
    tar xvzf tarball
    makepkg -s
    pacman -U ...
    No Problems here.
    When i run vim foo.java it shows me this mesage:
    Error detected while processing /usr/share/vim/vim73/plugin/vjde/vjde_template.vim:
    line   18:
    ArgumentError: invalid byte sequence in UTF-8
    Code on line 18:
    ruby Vjde::VjdeTemplateManager.load_all(VIM::evaluate('g:vjde_install_path'))
    So.. I'm no ruby programmer but i dont see any non UTF-8 Character in it.
    When i comment it out, the error does not show.
    Couldn't google anything about it. Maybe it's just a bug in the current version of Ruby.
    Would be nice if anyone can help me.
    Regards, Archdove
    Last edited by Archdove (2011-09-23 18:21:35)

    Hi,
    It's a encoding problem. I wrote about this problem to author. He uses en utf8 locale, but some files has unrecognized encoding. Enconv can't convert to utf8.
    $ find -type f -a ! -name readtags -a ! -name '*.class' -a ! -name '*.jar' | xargs enconv
    enconv: Cannot convert `./src/previewwindow.cpp' from unknown encoding
    enconv: Cannot convert `./src/wspawn.cpp' from unknown encoding
    enconv: Cannot convert `./src/tipswnd.lex' from unknown encoding
    enconv: Cannot convert `./src/vjde/completion/ClassInfo.java' from unknown encoding
    enconv: Cannot convert `./src/vjde/completion/Completion.java' from unknown encoding
    enconv: Cannot convert `./src/tipswnd.c' from unknown encoding
    enconv: Cannot convert `./plugin/vjde/vjde_java_completion.vim' from unknown encoding
    enconv: Cannot convert `./plugin/vjde/project.vim' from unknown encoding
    enconv: Cannot convert `./plugin/vjde/vjde_tag_loader.vim' from unknown encoding
    enconv: Cannot convert `./plugin/vjde/tlds/java.vjde' from unknown encoding
    I'm looking how to convert to utf8. Try open file e.g. src/previewwindow.cpp in vim with fencs=gbk,utf8,default. Vim detect fenc cp936. In line 644 are chinese characters(?): /* 另一个回调函数 */
    Any idea?

  • UTFDataFormatException, invalid byte 1 (�) of a 6-byte sequence

    Hi
    I am trying to parse xml file using sax parser(xerces-c) . i am not able to fix this error :
    UTFDataFormatException, invalid byte 1 (�) of a 6-byte sequence.
    xml file:
    <?xml version="1.0" ?>
    <!DOCTYPE svc_result SYSTEM "MLP_SVC_RESULT_310.dtd" [
    <!ENTITY % extension SYSTEM "PLS_PZSIR_100.DTD">
    %extension;]>
    ........

    Hi Siddiqui,
    It looks like u r importing some characters those are not valid UTF-8 character set and some time this type of error comes when u try to import characters like *<,>* so use *& lt;* for < and *>* for >.
    sorry those Characters r not display properly :-(
    Thanx
    Shant
    Edited by: Shant on Jan 18, 2008 6:19 AM
    Edited by: Shant on Jan 18, 2008 6:23 AM

  • Exception:java.io.UTFDataFormatException: invalid byte 2 of 2-byte UTF-8 se

    While feeding the parser with the xml string returned , the present data found contains some invalid UTF-8 characters(e.g, "�"). This would amount to a "java.io.UTFDataFormatException" exception.
    This is the code where I initialize the parser & feed the InputSource:
    public class ISEGeneralSearchResultsParser extends DefaultHandler{
    private static final String DEFAULT_PARSER_NAME     = "org.apache.xerces.parsers.SAXParser";
    private static final String VALIDATION               = "http://xml.org/sax/features/validation";
    private static final String NAMESPACE               = "http://xml.org/sax/features/namespaces";
    private static final String SCHEMA                    = "http://apache.org/xml/features/validation/schema";
    protected static boolean cbSetValidation           = false;
    protected static boolean cbSetNameSpaces           = false;
    protected static boolean cbSetSchemaSupport           = false;
    public void toRecord(String asXML)
              throws Exception
              try
                   ByteArrayInputStream byteStream = new ByteArrayInputStream(asXML.getBytes());
                   String lsParserName = DEFAULT_PARSER_NAME;          
                   try
                        lParser = (XMLReader)Class.forName(lsParserName).newInstance();
                        lParser.setFeature( VALIDATION, cbSetValidation);
         lParser.setFeature( NAMESPACE, cbSetNameSpaces);
         lParser.setFeature( SCHEMA, cbSetSchemaSupport);
         lParser.setContentHandler((DefaultHandler)this);
         lParser.setErrorHandler((DefaultHandler)this);
                   catch(Exception parserException)
                        throw new SNETException("ISE011");
                   lParser.parse(new InputSource((InputStream)byteStream));
              catch (Exception xmlStringException)
                   throw new SNETException("ISE012");
    My question how would I make the parser understand that the characters allowed could be also � for example?
    Thanking you in anitcipation!!
    Cheers

    My question how would I make the parser understand
    that the characters allowed could be also � for
    example?You would give it an XML file that declares its encoding properly. If it doesn't declare its encoding at all, you'd make sure it was really encoded in UTF-8. Hint: just stating an encoding in the XML's prologue doesn't mean that the data is really encoded that way. That's the responsibility of the creator of the file.

Maybe you are looking for

  • Original iPhone does not appear in iTunes

    My wife cracked her 3Gs, so while we wait for our new 4Gs to come, I thought I would crank up my original 1st gen for her tto use for a couple weeks. I did a total restore and now when I plug it into iTunes, it will show as a device but nothing appea

  • ITunes loads unchecked playlists onto ipod.

    Hello: My iTunes continues to load TOP 25 MOST PLAYED SONGS, even though it is not checked for syncing. Can anyone please help me? Thank-you.

  • Overdraft Facility - Payment wizard

    Hi All, When using the payment wizard, the bank GL account balance reflects as to how much is available to pay. How does one show the bank balance INCLUDING an overdraft facility as the amount available in the bank account for outgoing payments? e.g.

  • JavaHelp and JSF VWP

    Hi, My first time trying to use JavaHelp. I am developing a VWP using JSF and got the following error - JSF1015: Request path '/faces/com_sun_webui_jsf/help/navigator.jsp' begins with one or more occurrences of the FacesServlet prefix path mapping '/

  • Proper amount of DSP resources in router?

    Let's say we have a small site with 25 IP phones, 4 analog devices using a FXS module in the router and an ISDN PRI circuit using a T1 module in the router.  I assume a PVDM3 module with 64 DSPs would be more than enough to handle that site?  Does th