www.webdeveloper.com
Results 1 to 2 of 2

Thread: Fix Base64 or find alternative

Hybrid View

  1. #1
    Join Date
    Nov 2013
    Posts
    41

    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
    Location
    Ankh-Morpork
    Posts
    19,536
    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.)
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

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



Recent Articles