How can I set the encoding of EditText value?
I tried this but it does not seem to work.
String test = new String(myField.getText().toString().getBytes(), "Cp1251");
The receiver still has invalid value.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A string is always internally (in the String class) stored as unicode.
You should specify the encoding when you convert the string to bytes, and are sending the data.
That is, invoke getBytes(String encoding) on the string, and send the resulting byte array to the receiver.