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

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -