Code example for InputSource

Methods: setEncoding

0
        try { 
            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp = spf.newSAXParser();
            XMLReader xr = sp.getXMLReader();
            xr.setContentHandler(this);
            input.setEncoding("UTF-8");
            xr.parse(input);
        } catch (IOException e) {
            Log.e(TAG, e.toString());
            throw new SpotifyGatewayParseException(); 
        } catch (SAXException e) {
            Log.e(TAG, e.toString());
            throw new SpotifyGatewayParseException(); 
        } catch (ParserConfigurationException e) {
            Log.e(TAG, e.toString());
            throw new SpotifyGatewayParseException(); 
        } 
 
        return mTracks;
    }