Pound sign as £
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Pound sign as £
Pound sign as £
10-04-2017 3:44 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
In case anyone else experiences the same problem…
I have an HTML file on Hostopia that is displayed in an <iframe> on a ‘home pages’ server page.
From last week (3rd Apr onwards) sometime, the £ currency sign has been displaying as £. All other special characters seem OK
I assume this is a change (the PHP version change?) within Hostopia.
The problem is fixable by prefixing the HTML by <meta charset="UTF-8">
Re: Pound sign as £
10-04-2017 3:57 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I have seen this happen to a number of websites I have worked on in the past and this generally occurs on pages where text has been copied directly from an MS Word document. Characters that are affected can be dashes, apostrophes, ampersands and currency (amongst many many others). Changing the meta to UTF-8 fixes them in most cases but not always. I personally character encode all special characters with the proper HTML references as working on ISO entity sets was the norm until about 7 years ago. This wikipedia article is probably the most visited of my bookmarks:
https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
Frontend Web Developer | www.plus.net
If you have an idea to improve the community, create a new topic on our Community Feedback board to start a discussion about your idea.
Re: Pound sign as £
10-04-2017 7:43 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Have you escaped the character. The html should read £ rather than just have a pound sign character in the document. That way the browser will sort it out for you.
Re: Pound sign as £
10-04-2017 7:57 PM - edited 10-04-2017 8:02 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
If the HTML page were inline code then I would certainly have used £
But the page content is generated by the end-user, with PHP inserting some <div>s and appending an HTML prefix and suffix around whatever the user types in. In days gone by, PHP then FTPd this page to 'home pages' where it was displayed within a container page via SSI. The move to Hostopia put paid to progammatic outbound FTPs, hence the use of an <iframe>.
And to jaread83 reply, I have always found that charset list particularly memorable because amid the arcane mathematical symbols and Greek characters there is a hearts, spades, diamonds and clubs!
Re: Pound sign as £
11-04-2017 5:40 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
See: http://php.net/manual/en/function.htmlentities.php
Re: Pound sign as £
19-04-2017 3:29 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Yes Mike - thanks.
Later-developed pages do indeed use htmlentities() - and its inverse html_entitity_decode() when displaying the text for updating.
And lest anyone else has encountered the issue with PHP upgrade, it is not confined to <iframes>, but my workaround (in the original post) won't work for SSI-included text, because prefixing the SSI text by <meta charset="UTF-8"> is ignored, presumably because <meta> tags must be in <head> ... </head> and the SSI includes are in <body>...</body>. I just changed the charset of the SSI-including page to UTF-8 instead!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page