Alex Lord
asked on
64Decode stuck
\u003cii_jtobx3m60\u003e
here is the sample im trying to decode,
this is where it comes from, Gmail api
'body' => $getGmailService->gmailBodyDecode("\u003cii_jtobx3m60\u003e"),
decoding it with this function
function gmailBodyDecode($data) {
$data = base64_decode(str_replace(array('-', '_'), array('+', '/'), $data));
//$data = imap_qprint($data);
return($data);
}
it not doing anything, my application is took loading due to this.
any help ?
ASKER
Hey
https://stackoverflow.com/questions/49629310/not-able-to-display-embedded-images-in-html-using-gmail-api-rails
i am following this example, i am trying to get the inline image displayed in the message from gmail api.
https://stackoverflow.com/questions/49629310/not-able-to-display-embedded-images-in-html-using-gmail-api-rails
i am following this example, i am trying to get the inline image displayed in the message from gmail api.
That is not base64 encoded - those are unicode charcaters
\u003c is a '<'
\u003e is a '>'
Decoded it looks like this
<ii_jtobx3m60>
\u003c is a '<'
\u003e is a '>'
Decoded it looks like this
<ii_jtobx3m60>
You don't need to Base64 Decode that. Just run a json_decode on it:
$data = "\u003cii_jtobx3m60\u003e";
$string = json_decode('"' . $data . '"');
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Can you give more details on what you want exaclty please ?
and if you want to decode json, you can use this simple function:
Open in new window