Customer Portal

Get Involved. Join the Conversation.

Topic

    ashish bodhale
    Unable to decode multibyte (Japanese) base 64...
    Topic posted August 22, 2019 by ashish bodhaleBlue Ribbon: 750+ Points, last edited August 22, 2019 
    3 Views, 1 Comment
    Title:
    Unable to decode multibyte (Japanese) base 64 encoded data
    Summary:
    Unable to decode multibyte (Japanese) base 64 encoded data
    Content:

    Hi Team,

    We have our application where another team passes some data string in base 64 encoded format, which we decode at our end and populate some fields. This is working well in case of English characters. When Japanese characters are encoded and sent to us and when we are trying to decode it, it is failing. Can you please let me know if there is any solution to this?

    For eg. English characters encoding: eyJmaXJzdF9uYW1lIjoiSm9lIiwibGFzdF9uYW1lIjoiClRhY2NvIiwiZW1haWwiOiJqb2V0YWNjb0BnbWFpbC5jb20iLCJjb21wYW55IjoiSGFyZGNvcmUgQ2hpbGxpIiwiY291bnRyeSI6MTI2fQ==
    It is decoded using 
    json_decode(base64_decode($enc_data));

    For English characters, it decodes properly but for Japanese characters string:
    eyJmaXJzdF9uYW1lIjoi44K444On44O8IiwibGFzdF9uYW1lIjoi44K/44OD44KzIiwiZW1haWwiOiJqb2V0YWNjb0BnbWFpbC5jb20iLCJjb21wYW55IjoiSGFyZGNvcmUgQ2hpbGxpIiwiY291bnRyeSI6MTI2fQ==

    The same code does not work. When I tried to use this php code on online portal, it was able to decode it correctly, so I am not sure how to make it work in customer portal page?

    Thanks,
    Ashish

    Comment