Perhaps you use a different encoding in your Java application and then encode a PHP script. Try setting the encoding of your stream, for example, for example
URL oracle = new URL("http://www.yourpage.com/"); URLConnection yc = oracle.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader( yc.getInputStream(),"utf-8"));//<-- here you set encoding //to the same as in your PHP String inputLine; while ((inputLine = in.readLine()) != null) System.out.println(inputLine);
source share