Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
Decode Base64 with UCS-2 Encoding

I want to decode the Base64 result of MS-SQL Server in javascript, but I can't find a true solution. I know SQL Server uses UCS-2 encoding, and I have to use the same encoding to decode in javascript.

For example, for MwZEBicGRQY= the encoded result must be سلام.

Do you have any solution to decode that using javascript?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can first decode your base64 data into an Uint8Array, and then read the resulting data as UTF-16:

const base64_string = "MwZEBicGRQY";
// from https://stackoverflow.com/a/41106346/3702797
// may not be bullet-proof
const arr = Uint8Array.from(atob(base64_string), c => c.charCodeAt(0))
const decoded = new TextDecoder("UTF-16").decode(arr);

console.log(decoded);

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!