[sclug] URL encoding/decoding question
Will Dickson
wrd at glaurung.demon.co.uk
Mon Feb 20 18:38:45 UTC 2006
pieter claassen wrote:
> Ok, looks like mozilla is broken in regards to this matter.
>
> So, I thought this should work to intercept all inserts into the db and
> just convert them back to something civil?
>
> static public String decode (String data){
> data.replace(String.valueOf('\u20AC'),"€");
> return data;
> }
> However, no luck.
>
> My question. How do I print the "data" string in the above code in UTF
> format so that I can see what is being submitted to the DB?
Something like:
byte[] wad = data.getBytes("UTF-8");
for(int i=0; i<wad.length; i++)
System.out.println(Integer.toHexString( (wad[i] & 0xFF) ));
might do it.
Will.
More information about the Sclug
mailing list