Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

113
Vistas
Why quoted printable encoding operation in javascript and in Oracle returns different results?

Javascript:

//https://www.npmjs.com/package/utf8
//https://github.com/mathiasbynens/quoted-printable
par_comment_qoted = quotedPrintable.encode(utf8.encode('test ąčęė'));
console.log('par_comment_qoted='+par_comment_qoted);
// outpt: par_comment_qoted="test =C4=85=C4=8D=C4=99=C4=97"

Oracle:

select utl_raw.cast_to_varchar2(utl_encode.quoted_printable_encode(utl_raw.cast_to_raw('test ąčęė'))) from dual;
-- output: test =E0=E8=E6=EB

Why the same operation returns different outputs? Is there any way to make the javascript as well so that it returns the same quoted printable encoding result as Oracle?

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

You can try using CONVERT to change the string from the database character set to UTF-8 before generating the quoted printable:

select utl_raw.cast_to_varchar2(
         utl_encode.quoted_printable_encode(
           utl_raw.cast_to_raw(
             CONVERT('test ąčęė', 'UTF8')
           )
         )
       ) AS quoted_printable
from   dual;

Which outputs:

QUOTED_PRINTABLE
test =C4=85=C4=8D=C4=99=C4=97

db<>fiddle here

Is there any way to make the javascript as well so that it returns the same quoted printable encoding result as Oracle?

You would need to work out what the database's character set is and then encode the JavaScript string using that encoding (rather than UTF-8) and generate the printed quotable based on the other character set.

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda