Spanish Characters not Displaying Correctly

后端 未结 7 1982
心在旅途
心在旅途 2021-02-08 12:24

I am getting the lovely � box where spanish characters should be displayed. (ie: ñ, á, etc). I have already made sure that my meta http-equiv is set to utf-8:

&         


        
7条回答
  •  失恋的感觉
    2021-02-08 13:12

    Having a similar problem, I found the answer here. Not Displaying Spanish Characters

    The resolution was to change from UTF-8 to windows-1252.

    (HTML) 
    (PHP) ini_set('default_charset', 'windows-1252');
    

    My problem was reading Spanish characters from a CSV file. When I opened the file in Excel, the characters appeared fine. In my editor, the odd character was shown regardless of the intended character. This change seems to work for my requirements.

提交回复
热议问题