Q:

java 7 decode base64 String with accent

I have a problem to decode a string encoded with pl/sql encoded with oracle pl/sql like this
SET SERVEROUTPUT ON DECLARE

l_vc_var1 VARCHAR2(32767):='nat=Assurés%20CNRPS';

l_rw_var2 RAW(32767);

BEGIN

dbms_output.put_line('Original string: '||l_vc_var1);

l_rw_var2:= utl_raw.cast_to_raw(l_vc_var1);

dbms_output.put_line('Original RAW string: '||l_rw_var2);

l_rw_var2:= utl_encode.base64_encode(l_rw_var2);

dbms_output.put_line('Encoded RAW string: '||l_rw_var2);

l_rw_var2:= utl_encode.base64_decode(l_rw_var2);

dbms_output.put_line('Decoded RAW string: '||l_rw_var2);

l_vc_var1:=utl_raw.cast_to_varchar2(l_rw_var2);

dbms_output.put_line('Decoded Original string: '||l_vc_var1);

END;

/

The result in sqldeveloper:

Original string: nat=Assurés%20CSS Original RAW string:
  6E61743D4173737572E973253230435353 Encoded RAW string:
  626D46305055467A6333567936584D6C4D6A424455314D3D 
  Decoded RAW string: 6E61743D4173737572E973253230435353 
  Decoded Original string: nat=Assurés%20CSS

I want to decode the String with Java like this:
try {
    String base64 = "6E61743D4173737572E973253230435353";
    BigInteger bi = new BigInteger(base64, 16);
    byte[] bdata = bi.toByteArray();

    String temp = new String(bdata, "UTF-8");
    System.out.println("temp =   " + temp);

} catch (Exception ex) {
    ex.printStackTrace();
}

unfortanly the accent is not correct with java result :

temp =   nat=Assur�s%20CSS

A:

new String(bdata, "ISO-8859-1"), ISO Latin-1.
"Windows-1252", MS Windows Latin-1, would be a superset, and probably was used by SQLDeveloper.

