parsing - Java URL reader throwing IO Exception when reading special character -
i'm having problem reading json of url, when input has character "é" (alt130). strange part program works when launched within netbeans ide, doesn't when launched distribution jar. here's code i'm using:
public class urlreader { private url url; private bufferedreader in; private string inputline; public void gettextfromurl(string address) { try { url = new url(address); gui.textarea.append("url created\n"); in = new bufferedreader(new inputstreamreader(url.openstream(),"utf-8")); gui.textarea.append("buffered reader created\n"); while((inputline = in.readline()) != null) gui.textarea.append(inputline+"\n"); in.close(); } catch (ioexception ex) { gui.textarea.append("io exception"); } }
the output when program launched within netbeans ide following:
however when launch program dist jar, output this:
the url object seems created fine, bufferedreader seems throw ioexception. wrong?
Comments
Post a Comment