I am using JDK 1.6 and facing issue while trying to encoding/decoding French words. My code is under:
String setText = "Vos factures impayées Internet sont";
String encodedText= Base64.encode(setText.getBytes());
Base64.decode(encodedText);
System.out.println("Encoded String: " + encodedText);
byte[] result = Base64.decode(encodedText);
String decodedString = new String(result);
System.out.println("Decoded: " + decodedString);
Result is: Original String Vos factures impayées Internet sont
Encoded String: Vm9zIGZhY3R1cmVzIGltcGF577+9ZXMgSW50ZXJuZXQgc29udA==
Decoded: Vos factures impay�es Internet sont
Issue: In decoding string i am getting " � " special character instead of "é"