UTF-8 issue in Firefox - response header overriding meta tag?

前端 未结 2 1458
甜味超标
甜味超标 2021-01-20 04:26

I have a page with the following meta tag:


I thought this w

相关标签:
2条回答
  • 2021-01-20 05:19

    The URL alias http://monthlymixup.com/mixups/july_2012/media/nick/Guessi-Gu%C3%A9r%C3%A9-Guessi%20%28Pop%20Bariba%29.mp3 works OK on Firefox, too. So the problem is appearently on the linking page. The problem can be reproduced using the following test page:

    <!doctype html>
    <title></title>
    <meta charset=iso-8859-1>
    <a href=
    "http://monthlymixup.com/mixups/july_2012/media/nick/Guessi-Gu%e9r%e9-Guessi%20%28Pop%20Bariba%29.mp3"
    >link</a>
    

    Thus, the problem is in the PHP code that generates the linking page. It seems to % encode the letter “é” on its own, using the ISO-8859-1 based encoding %e9 instead of the proper UTF-8 based encoding.

    Make sure that the linking page is generated correctly, with the letter “é” rather than any % encoded form or the UTF−8 based encoding %C3%A9.

    0 讨论(0)
  • 2021-01-20 05:32

    It turns out that there was an issue with the Flash fallback in jPlayer. Firefox uses Flash to play the mp3.

    Here's the fix from the developer of jPlayer:

    Use the encodeURI(url) JavaScript command to encode the URL in JavaScript before passing the url to setMedia. For example:

    $ ("#id").jPlayer("setMedia", {
       mp3: encodeURI("http://domain.com/audio/大地書房.mp3")
    });
    
    0 讨论(0)
提交回复
热议问题