URL url = new URL("http://soandso.com");
String userpassword = username + ":" + password;
conn = (HttpURLConnection)url.openConnection();
conn.setDoOutput(true);
conn.setRequestMethod("POST");
BASE64Encoder enc = new sun.misc.BASE64Encoder();
String encodedAuthorization = enc.encode( userpassword.getBytes() );
conn.setRequestProperty("Authorization", "Basic "+encodedAuthorization);
OutputStreamWriter writer =new OutputStreamWriter(conn.getOutputStream());
writer.write("ABC");
writer.flush ();
writer.close();
BufferedReader rd =new BufferedReader(new InputStreamReader(conn.getInputStream()));
while ((inputLine = rd.readLine()) != null)
System.out.println(inputLine);
产出一如下。
ÃœNÄ°TESÄ°TOPLANTI SALONU
但 实际产出本应是: ÜNITES 51 TOPLANTI SALONU。
谁能告诉我如何解决这一问题?
PS:该法典不来自任何保留。 它不是一个 j子。