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

146
Vistas
How to encode html code or url to this format \u00253Cbr\....?

How to encode html code or url to this format?:

\u00253Cb\u002522\.... 

THANK YOU!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

To convert URL to this you need to convert your URL (string) to unicode format

you can try following function for it.


// here toUnicode function is attached to string so that it can used further with 
//other strings also

String.prototype.toUnicode = function(){
    var result = "";
    for(var i = 0; i < this.length; i++){
        // Assumption: all characters are < 0xffff
        result += "\\u" + ("000" + this[i].charCodeAt(0).toString(16)).substr(-4);
    }
    return result;
};

let name = "john";

name.toUnicode(); // this will return unicodes of strings

And on another side you can get the Unicode URL using window.location.href (which will be in unicode) you can convert back into string using following function.

// this function coverts the unicode to string char by char 
// so you need to loop through the string and call this function a
//nd create resultant string

function unicodeToChar(text) {
   return text.replace(/\\u[\dA-F]{4}/gi, 
          function (match) {
               return String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16));
          });
}
about 4 years ago · Juan Pablo Isaza 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