A
Amith
Hello all,
I have a problem, when i read a webpage contents (with UTF-8
characterset) and try to display it.. it is just considered as unicode
string
please help me
here is the code
import java.net.*;
import java.io.*;
public class URLReader {
public static void main(String[] args) throws Exception {
URL url = new URL("http://www.google.com/transliterate/indic?
tlqt=1&langpair=en|kn&text=namskara%20guru&&tl_app=1");
BufferedReader in = new BufferedReader(
new InputStreamReader(
url.openStream(), "UTF8"));
String inputLine = "";
String fullString = "";
while ((inputLine = in.readLine()) != null)
fullString = fullString + new String(inputLine.getBytes(),"UTF-8");
String string = fullString.substring(fullString.indexOf("[\"") + 2,
fullString.indexOf("\",]"));
System.out.println(string);
in.close();
}
}
I have a problem, when i read a webpage contents (with UTF-8
characterset) and try to display it.. it is just considered as unicode
string
please help me
here is the code
import java.net.*;
import java.io.*;
public class URLReader {
public static void main(String[] args) throws Exception {
URL url = new URL("http://www.google.com/transliterate/indic?
tlqt=1&langpair=en|kn&text=namskara%20guru&&tl_app=1");
BufferedReader in = new BufferedReader(
new InputStreamReader(
url.openStream(), "UTF8"));
String inputLine = "";
String fullString = "";
while ((inputLine = in.readLine()) != null)
fullString = fullString + new String(inputLine.getBytes(),"UTF-8");
String string = fullString.substring(fullString.indexOf("[\"") + 2,
fullString.indexOf("\",]"));
System.out.println(string);
in.close();
}
}