java - Weird Characters Displayed on Build, but not on Debug -


i'm developing java application using netbeans, while run app in debug, or plain running netbeans, screen looks so: good. yet, when try run built jar in dist folder, looks so: bad.

here method in using receive content. method intended source of text file web.

public static arraylist<string> geturlsource(string urlf) throws ioexception {     url url = new url(urlf);     scanner s = new scanner(url.openstream());     arraylist<string> filelines = new arraylist<>();     while (s.hasnextline())     {         filelines.add(s.nextline());     }     return filelines; } 

the default charset may different depending on how launch application. try specifying charset explicitly :

scanner s = new scanner(url.openstream(), "utf-8"); 

Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -