Sorry, I don't speak English very well.
I try to send string "Nhập nội dung bình luận để gửi đi!".
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(link);
String str ="Nhập nội dung bình luận để gửi đi!";
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("file", str));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
But I get "Nhập nội dung bình l" on my web server. How can I resolve it.
EDIT:
I encoded to UTF-8 by this code:
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
replace by:
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs,"UTF-8"));
but it still doesn't work.