I encoded a canvas-image to base64 which gives me this:
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAICAgICAQICAgICAgIDAwYEAwMDAwcFBQQGCAcICAgHCA
You write encodeURIComponent (JS) and then utf8_decode (PHP). Just use urldecode (PHP) and it will work fine! :)
encodeURIComponent
utf8_decode
urldecode