Euro sign not showing on site

后端 未结 3 724
说谎
说谎 2021-01-18 00:07

One of my fields (which is a latin1_swedish_ci) seems to show the euro symbol fine in PHPMYADMIN inside of the field.

However, when I try to echo it in an input fie

3条回答
  •  余生分开走
    2021-01-18 00:47

    If you are serving the page as UTF-8, you will need to ensure you grab the string out of the database in the UTF-8 encoding before putting it on the page. You can do that using:

    mysql_set_charset('utf8');
    

    (If you're doing that it would also make sense to store your actual table data in UTF-8 too, eg utf8_general_ci, rather than latin1_swedish_ci, so you can deal properly with characters outside of the basic Latin-1 set.)

提交回复
热议问题