Bug #1994

showtime.entityDecode doesn't decode numeric &#xxx; chars

Added by Leonid Protasov about 7 years ago. Updated about 7 years ago.

Status:InvalidStart date:02/17/2014
Priority:NormalDue date:
Assignee:Andreas Smas% Done:

0%

Category:API
Target version:4.6
Found in version:Latest Platform:Linux

History

#1 Updated by Leonid Protasov about 7 years ago

I did it by:

    function fixNumEntities(s) {
        return s.replace(/&#([^\s]*);/g, function(match, match2) { return String.fromCharCode(Number(match2)); });
    }

   title: fixNumEntities(showtime.entityDecode(match[1])),

But ST could do that itself...

#2 Updated by Andreas Smas about 7 years ago

  • Status changed from New to Need feedback

Please include an example that doesn't work

#3 Updated by Leonid Protasov about 7 years ago

For example string: Testé

Testé

#4 Updated by Andreas Smas about 7 years ago

showtime.print(showtime.entityDecode("Testé"));

prints

Testé

for me

#5 Updated by Leonid Protasov about 7 years ago

Ah, now I see why - that is double entity encoded:

showtime.print(showtime.entityDecode('Мари – кукла / Куколка Мари / Marie-poupée / Marie-poupee (1976/DVDRip)'));

#6 Updated by Andreas Smas about 7 years ago

Chrome does the same thing as Showtime here.

<html>
  <body>
    Marie-poup&amp;#233;e
  </body>
</html>

renders in chrome as:

Marie-poup&#233;e

#7 Updated by Leonid Protasov about 7 years ago

well, infact showtime.entityDecode(showtime.entityDecode('Marie-poup&#233;e'))) does the job, so frankly I don't know if Showtime should be wiser on entity decodes then Chrome.
I suppose that is Chrome's bug/feature...

#8 Updated by Andreas Smas about 7 years ago

  • Status changed from Need feedback to Invalid

Seems to me like the site where the data is coming from is broken.

Also available in: Atom PDF