OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Using Javascript's atob to decode base64 doesn't properly decode utf-8 strings

  • Thread starter Thread starter brandonscript
  • Start date Start date
B

brandonscript

Guest
I'm using the Javascript window.atob() function to decode a base64-encoded string (specifically the base64-encoded content from the GitHub API). Problem is I'm getting ASCII-encoded characters back (like ⢠instead of ). How can I properly handle the incoming base64-encoded stream so that it's decoded as utf-8?

<p>I'm using the Javascript <code>window.atob()</code> function to decode a base64-encoded string (specifically the base64-encoded content from the GitHub API). Problem is I'm getting ASCII-encoded characters back (like <code>â¢</code> instead of <code>™</code>). How can I properly handle the incoming base64-encoded stream so that it's decoded as utf-8?</p>
 

Latest posts

Top