I have a String with a "ñ" character and I have some problems with it. I need to encode this String to UTF-8 encoding. I have tried it by this way, but it doesn't work:
byte ptext[] = myString.getBytes();
String value = new String(ptext, "UTF-8");
How do I encode that string to utf-8?
{In,Out}putStream{Read,Writ}ers
do it for them. I wonder why? – Illative/u
in Python; same problem with PHP. With Perl 5.14, now in RC1 testing, you can finally get all Unicode strings. Perl regexes are still a lot more Unicode-friendly than Java’s, but I’ve been working with the JDK7 people to fix that. – Illative