Code example for InputSource

Methods: setEncoding

0
            SAXParser sp = spf.newSAXParser();
            XMLReader xReader = sp.getXMLReader();
            SMILHandler sHandler = new SMILHandler();
 
            xReader.setContentHandler(sHandler);
            InputSource in = new InputSource(is);
            in.setEncoding("UTF-8");
            xReader.parse(in);
 
 
        } catch (ParserConfigurationException e) {
            //Bad ParserFactory 
        	System.err.println("ParserFactory: " + e);
        } catch (SAXException e) {
            //Bad SAXParser 
        	System.err.println("SAXParser: " + e);
        	e.printStackTrace();
        } catch (IOException e) {
            //Bad XMLReader 
        	System.err.println("XMLReader: " + e);
Stop searching for code, let great code find you!  Add Codota to your java IDE