i want how to get the content from websites with utf8 format,,
i have writing the following code is
try {
String webnames = "http://pathivu.com";
URL url = new URL(webnames);
URLConnection urlc = url.openConnection();
//BufferedInputStream buffer = new BufferedInputStream(urlc.getInputStream());
BufferedReader buffer = new BufferedReader(new InputStreamReader(urlc.getInputStream(), "UTF8"));
StringBuilder builder = new StringBuilder();
int byteRead;
while ((byteRead = buffer.read()) != -1)
builder.append((char) byteRead);
buffer.close();
String text=builder.toString();
System.out.println(text);
}
catch (IOException e)
{
e.printStackTrace();
}
but i cant get the correct format...
thanks and advance..