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);
Experience pair programming with AI  Get Codota for Java