Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
105
rated 0 times [  110] [ 5]  / answers: 1 / hits: 43122  / 11 Years ago, wed, april 10, 2013, 12:00:00

How to use JavaScript to decode from:



u003cbu003estringu003c/bu003e


to



<b>string</b>


(I searched in internet, there are some site with same question, such as:
Javascript html decoding

or
How to decode HTML entities

but it dont have same encode fomat)

Thank you very much!


More From » unicode

 Answers
7
decodeURIComponent('u003cbu003estringu003c/bu003e');

// <b>string</b>


Edit - I would delete the above answer if I could.



The original question is a bit ambiguous.



console.log('u003cbu003estringu003c/bu003e'); will already yield <b>string</b>



If the characters are escaped, then a replacement method could be used to replace \ with just , thus allowing the proper Unicode escape sequence.


[#78986] Tuesday, April 9, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
patienceannel

Total Points: 674
Total Questions: 101
Total Answers: 101

Location: Northern Mariana Islands
Member since Fri, Jan 15, 2021
3 Years ago
patienceannel questions
Fri, Mar 11, 22, 00:00, 2 Years ago
Tue, Oct 20, 20, 00:00, 4 Years ago
Wed, Jul 24, 19, 00:00, 5 Years ago
;