Hello to all. Got a question. There is a rss parser. It works well, but only with rss tapes that use UTF-8, and I need it to work with windows-1251. Here is a piece of code:

SAXParserFactory mySAXParserFactory = SAXParserFactory.newInstance(); SAXParser mySAXParser = mySAXParserFactory.newSAXParser(); XMLReader myXMLReader = mySAXParser.getXMLReader(); RSSHandler myRSSHandler = new RSSHandler(); myXMLReader.setContentHandler(myRSSHandler); InputSource myInputSource = new InputSource(rssUrl.openStream()); myXMLReader.parse(myInputSource); 

Tell me please.

    1 answer 1

    Hey. Try for InputSource to use "setEncoding", i.e. in your case:

     myInputSource.setEncoding("windows-1251");