0

I have the following string in NodeJS:

'3ª Jornada: Resumen 2'

which should be shown as:

'3ª Jornada: Resumen 2'

I have been trying to convert it to another

decodeURIComponent(escape(myString))

but it did not work.

Any ideas?

1 Answer 1

1

According to this code snippet, I finally managed to do it in the following way:

myString = myString.replace(/&#(x[0-9A-Fa-f]{2});/g, function(match, hex) {
    return String.fromCharCode('0' + hex);
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.