I thought utf-8 would be able to handle just a neat £ instead of having to convert to entities?
What’s the proper way of handling the GBP symbol with UTF-8 and HTML5?
(ps. don’t think the html5 part should make any difference)
update:
Here’s test document:
<!doctype html>
<head>
<meta charset="utf-8">
<title>GBP Test</title>
</head>
<body>
£55
<br />
£55
</body>
Thanks everyone for your help.
For anyone else facing this frustration the issue comes with your text editor. Even Notepad formats in non utf-8.
SOLUTION:
Changed Read and Write formats to
UTF-8 in my text editor (PHP
Designer)
Just use the character. It will work fine.
The symbol has a different code point in UTF-8 than in ISO-8859-1 of course. A ISO-8859-1 encoded pound sign will not work in UTF-8, and vice versa. You’d have to convert it.
Related: When Should One Use HTML Entities