Results 1 to 2 of 2

Thread: Fix Base64 or find alternative

  1. #1
    Join Date
    Nov 2013

    Fix Base64 or find alternative

    I'm using Base64 to encode a preferences cookie. The problem is with the o-slash character () or &oslash. 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.

  2. #2
    Join Date
    Aug 2004
    You may be able to use mb_convert_encoding():
    PHP Code:
    $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.)
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center