0

I have a string which basically looks like this:

20 pcs 1/4" d 13/32" l shank copper round head solid rivets fasteners

or :

20 Pcs 1/4" D 13/32" L Shank Copper Round Head Solid Rivets Fasteners

Where " should be represented as: " characther...

In my JS method I set the label value to following:

function WriteTitle(sentTitle){
 $("#myTitle").text(sentTitle);
}

I have tried using methods like decodeURIComponent, unescape or similar to parse these characthers but no luck so far...

How can I parse these into normal characters?

User987
  • 3,663
  • 15
  • 54
  • 115
  • This may be a duplicate: https://stackoverflow.com/questions/7885096/how-do-i-decode-a-string-with-escaped-unicode – Nick Oct 12 '17 at 17:51

1 Answers1

1

These are not unicode characters but HTML entities. You should use .html() method, it won't escape them (that's exactly what .text() does).

function WriteTitle(sentTitle){
  $("#myTitle").html(sentTitle);
}
Styx
  • 9,863
  • 8
  • 43
  • 53