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

261
Views
Why BASE64 encode/decode works differently in javascript and Oracle

I encode a string 'test me ąčęėįš' in javascript like this:

  function toBinary(string) {
    const codeUnits = new Uint16Array(string.length);
    for (let i = 0; i < codeUnits.length; i++) {
      codeUnits[i] = string.charCodeAt(i);
    }
    return String.fromCharCode(...new Uint8Array(codeUnits.buffer));
  }

  console.log(btoa(toBinary('test me ąčęėįš')));
  // output:  dABlAHMAdAAgAG0AZQAgAAUBDQEZARcBLwFhAQ==

If I encode the same string i Oracle base64 encoding generates different output:

select utl_encode.BASE64_ENCODE(utl_raw.cast_to_raw('test me ąčęėįš')) from dual;
-- output 6447567A644342745A534467364F62723466413D

Why is that? Does BASE64 encoding/decoding work differently in Oracle and javascript? Of course when I try in Oracle decode javascript encoded string it not work:

select utl_encode.base64_decode('dABlAHMAdAAgAG0AZQAgAAUBDQEZARcBLwFhAQ==') from dual;
-- output: ORA-01465: invalid hex number

How in Oracle decode in javascript base64 encoded string?

about 4 years ago · Juan Pablo Isaza
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!