Code example for CharsetDecoder

Methods: decode

0
         
        String txtFinal = "";
 
        try { 
            ByteBuffer bbuf = encoderOrigem.encode(CharBuffer.wrap( txtInicial ));
            CharBuffer cbuf = decoderDestino.decode(bbuf);
            txtFinal = cbuf.toString();
        } catch (CharacterCodingException e) {
            e.printStackTrace();
            //Log.v("nophonezone","error charset exception = " + e.toString()); 
        } 
         
        if (txtFinal.length() == 0) txtFinal = txtInicial;
 
        return txtFinal;
    } 
 
    public void exitApplication () { 
    	SettingsActivity.setVolume(getApplicationContext(), false);
    	dh.clearWarnings();
    	this.finish();