欧元符号不在网站上显示

欧元符号不在网站上显示

本文介绍了欧元符号不在网站上显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个领域(这是一个latin1_swedish_ci)似乎在该领域的PHPMYADMIN中显示欧元符号。 然而,当我尝试在我的网站上的输入字段中以表单形式回显它时,它显示为firefox中的问号。



继承html / php:

  $ sql = mysql_query(select * from` settings`); 
$ b $ while($ row = mysql_fetch_assoc($ sql))
$ setting [$ row ['field']] = htmlspecialchars($ row ['value'],ENT_QUOTES);

我在网页上使用以下元标记:

 < meta http-equiv =Content-Typecontent =text / html; charset = UTF-8/> 

我试过使用utf8_general_ci作为字段,但我得到了相同的结果。

解决方案

尝试使用而不是 htmlspecialchars()



特殊字符不会转换所有内容,只是几个选择字符。欧元符号€,需要真正编码,& euro;


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 field on my website in a form, it shows up as the question-mark in firefox.

Heres the html/php:

$sql = mysql_query("select * from `settings`");

while ($row = mysql_fetch_assoc($sql))
    $setting[$row['field']] = htmlspecialchars($row['value'], ENT_QUOTES);

<input type="text" name="currency_symbol" id="currency_symbol" size="50" value="<?php echo $setting['currency_symbol']; ?>" />

I am using the following meta tag on the page:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

I've tried using utf8_general_ci for the field, but I get the same result.

解决方案

Try using htmlentities() instead of htmlspecialchars().

Special chars does not convert everything, just a few select characters. The Euro symbol €, needs to be encoded really, &euro;.

这篇关于欧元符号不在网站上显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 04:46