Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Euro sign not showing on site

Tags:

html

php

mysql

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.

like image 331
scarhand Avatar asked Jul 25 '11 00:07

scarhand


People also ask

Why is the Euro sign not working on keyboard?

Hold down Alt and type 0128 to get a Euro key to appear.

How do you get the € sign on a keyboard?

To type the Euro symbol (€) in Microsoft Word for Windows, press CRTL + ALT + E.

Why is the Euro sign not showing in Excel?

#1 – Using Shortcut Key We can use a shortcut key to insert the “EURO” symbol in the cell of MS Excel. The shortcut key is “Alt+0128.” We need to press the keys for “0”, “1”, “2,” and “8” while pressing the “Alt” key to enter the “EURO” symbol in the cell.


1 Answers

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;.

like image 92
Orbling Avatar answered Oct 06 '22 00:10

Orbling