Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The first thing you should do is determining the real encoding of the xml file, as Tomalak suggests, not the encoding stated in header.</p> <p>You can start by opening it with Internet Explorer. If encoding is not correct you may see an error like this:</p> <blockquote> <p>An invalid character was found in text content. Error processing resource ...</p> </blockquote> <p>Or the following one:</p> <blockquote> <p>Switch from current encoding to specified encoding not supported. Error processing resource ...</p> </blockquote> <p>Using a text editor with several encodings support is the next step. You can use <a href="http://notepad-plus.sourceforge.net/es/site.htm" rel="nofollow noreferrer">Notepad++</a> that is free, easy to use and supports several encodings. No matter what xml header says about encoding, the editor tries to detect encoding of the file and displays it on status bar.</p> <p>If you determine that the file encoding is correct then you may be not handling correctly the encoding inside Java. Take into account that Java strings are UTF-16 and by default when converting from/to byte arrays, if no encoding is specified Java defaults to system encoding (Windows-1521 under Windows or UTF-8 on modern Linuxes). Some encoding conversions only cause "strange" characters to appear, such as conversions between fixed 8 bit encodings (ie Windows-1252 &lt;-> ISO-8859-1). Other conversions raise enconding exceptions because of invalid characters (try importing Windows-1252 text as UTF-8 for example).</p> <p>An example of invalid code is the following:</p> <pre><code>// Parse the input SAXParser saxParser = factory.newSAXParser(); InputStream is = new ByteArrayInputStream(stringToParse.getBytes()); saxParser.parse( is, handler ); </code></pre> <p>The conversion <code>stringToParse.getBytes()</code> returns by default the string encoded as Windows-1252 on Windows platforms. If the XML text was encoded in ISO-8859-1 at this step you have wrong characters. The correct step should be reading XML as bytes and not a String and let SAX manage xml encoding.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload