Re: How to encode byte array as url parameter

2005-06-22 Thread Michael Jouravlev
Base64 will not work, because its charset includes + and / ASCII characters. So you might write something like strToHex() (or whatever its name is), for example see Cryptix library, Hex utility class. Or you can just use that class directly. On the other hand, you may use Base64, and then

Re: How to encode byte array as url parameter

2005-06-22 Thread Dave Newton
David Erickson wrote: Hi I am wondering how I can take a byte[] and use it as a URL parameter? I have tried converting it to a string using varying character sets, but when I call string.getbytes I never get back my original array. Any help would be greatly appreciated. Googled url encode

RE: How to encode byte array as url parameter

2005-06-22 Thread David Erickson
Thanks the base64 combined with URLEncoder should work great. -David -Original Message- From: Michael Jouravlev [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 22, 2005 1:36 PM To: Struts Users Mailing List Subject: Re: How to encode byte array as url parameter Base64

RE: How to encode byte array as url parameter

2005-06-22 Thread David Erickson
I took a look at that commons encoder and for encoding a byte[] it returns a byte[].. seems pointless to me? -David -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 22, 2005 1:41 PM To: Struts Users Mailing List Subject: Re: How to encode byte

Re: How to encode byte array as url parameter

2005-06-22 Thread Dave Newton
David Erickson wrote: I took a look at that commons encoder and for encoding a byte[] it returns a byte[].. seems pointless to me? Or use String encode(new String(byte[])). Or look at the second reference; all you have to do is put %HH where HH is the hex ASCII rep of the character in

Re: How to encode byte array as url parameter

2005-06-22 Thread Martin Gainty
@struts.apache.org Sent: Wednesday, June 22, 2005 3:54 PM Subject: RE: How to encode byte array as url parameter I took a look at that commons encoder and for encoding a byte[] it returns a byte[].. seems pointless to me? -David -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED

RE: How to encode byte array as url parameter

2005-06-22 Thread David Erickson
: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 22, 2005 2:17 PM To: Struts Users Mailing List Subject: Re: How to encode byte array as url parameter David Any reason why you're not constructing java.net.URL from string? and then using toExternalForm() to convert back

Re: How to encode byte array as url parameter

2005-06-22 Thread Laurie Harper
wrote: Thanks the base64 combined with URLEncoder should work great. -David -Original Message- From: Michael Jouravlev [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 22, 2005 1:36 PM To: Struts Users Mailing List Subject: Re: How to encode byte array as url parameter Base64 will not work

RE: How to encode byte array as url parameter

2005-06-22 Thread David Erickson
Thanks Laurie that is useful information. -David -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Wednesday, June 22, 2005 8:39 PM To: user@struts.apache.org Subject: Re: How to encode byte array as url parameter Just to add to your options