How to convert string like that for example "Bohinjska Češnjica"
. The string that I get from the website and it is not encoded in unicode
. It works just fine in program that uses swing(Netbeans
), but when I past the link to jar to windows console(to run jframe
application) it doesn't show correct characters in the string "Bohinjska Češnjica"
for characters 'Č'
and 'š'
.
String example="Bohinjska Češnjica";
I get that string from website.
How do I encode or show as it is ("Bohinjska Češnjica")
in a Swing application, so when i will run a jframe
application it will show me this characters(and others unicode characters ofcourse ('Ž','ž','č' and 'Š'))?
Link 1 :jar file of my program runned from console Link 2:when i run program from netbeans
READING CONTENT FROM WEBSITE :
URL nov = new URL("http://www.arso.gov.si/vreme/napovedi%20in%20podatki/vreme_avt.html");
URLConnection conn = nov.openConnection(); //connect to a website
BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String inputLine;
StringBuilder niz = new StringBuilder();
while ((inputLine = br.readLine()) != null) {
String vrstica = inputLine.trim(); //reading html...
}