2008/9/2 Gundersen, Richard <[EMAIL PROTECTED]>:
> It's a base64-encoded string, so I thought I'd be able to just pass it
> through as a request parameter, but I found out it contains newline
> chars every 64 characters (which I read is correct), so any JavaScript I
> write etc gets all messed up because of these newlines
>
> I was wondering if Struts has any tags that I could use for handling
> this?

Try Commons Codec:
http://commons.apache.org/codec/api-release/org/apache/commons/codec/binary/Base64.html#decodeBase64(byte[])
This way you obtain a series of octets (bytes). To convert it into a
string, you need to know the character set used for the character
encoding. You can use, for example, a ByteArrayInputStream and, after
that, an InputStreamReader with the correct encoding.

HTH
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to