I'm using Base64 to encode a preferences cookie. The problem is with the o-slash character (ø) or ø. When I encode and then decode it with PHP I get: \xc3\xb8 I think this has to do with ANSI or UTF-8. Is there a good alternative to Base64? I'm not too much worried about size. Yes, I know the difference between hash, encode, and encrypt. I also tried Hexadecimal to no avail. Base32, while it probably wouldn't work, would be too slow. I hope that there is a workaround for this.
You may be able to use mb_convert_encoding():
$decoded = mb_convert_encoding( $string, "UTF-8", "BASE64" );
(Change "UTF-8" to whatever the actual character set is you want to use -- though I recommend UTF-8 if possible.)