SitePoint Sponsor |
|
User Tag List
Results 1 to 13 of 13
-
Nov 25, 2008, 12:25 #1
- Join Date
- Mar 2008
- Location
- United Kingdom
- Posts
- 1,285
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Retrieving £ from db, want to keep it in that format
Hi,
The following characters sometimes appear at the top of my web page: 
It seems to only happen when I'm trying to display the £ symbol on my website in Firefox. In front of each £ symbol it has a Â.
I've got the £ symbol stored in my database as £ do I need to do anything special to stop it converting to £ when on the web page?
Perfect world I'd want £ in my HTML rather than it being converted to £.
My charset is <meta http-equiv="content-type" content="text/ html;charset=utf-8" />
Thank you for any help.
-
Nov 25, 2008, 12:35 #2
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
Every & you want to display in your web page needs to be specified as &
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Nov 25, 2008, 12:39 #3
- Join Date
- Mar 2008
- Location
- United Kingdom
- Posts
- 1,285
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes, but I would like to also display £ in my web page, but Firefox seems to change it to £ when its coming from the db, which is giving me problems.
Would it be harmful to change my Charset from UTF-8 to something else?
Like I say, it's a fairly intermittent issue, but I'd prefer not to have it at all
-
Nov 25, 2008, 15:57 #4
- Join Date
- Mar 2008
- Location
- United Kingdom
- Posts
- 1,285
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Definitely seems to be a UTF-8 encoding issue.
I'm taking the value £ from my db and 99% it displays the pound symbol fine, but sometimes it adds the  to the top of my page and then  in front of some of my £ symbols.
Has anyone found a fix for this?
I may have to just display the pound symbols client-side if there's no way around it.
-
Nov 25, 2008, 16:21 #5
- Join Date
- Apr 2007
- Posts
- 1,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Nov 25, 2008, 16:24 #6
- Join Date
- Mar 2008
- Location
- United Kingdom
- Posts
- 1,285
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Aaaaaah, so even for £ I have to use &pound; ???
I'm using UTF-8 just now, should I expect any major issues if I change my Charset?
Thanks for your help.
-
Nov 25, 2008, 16:27 #7
- Join Date
- Apr 2007
- Posts
- 1,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Nov 25, 2008, 16:29 #8
- Join Date
- Mar 2008
- Location
- United Kingdom
- Posts
- 1,285
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Right. I want to display the £ symbol, so I'll just use £ or & # 1 6 3 ; ?
Sorry to ask again, but will I lose my valid XHTML if I change charset? All the data is taken from a MySQL database - do I need to make any charset changes there?
Apologies again for the sheer newbness of the query.
-
Nov 25, 2008, 16:39 #9
- Join Date
- Apr 2007
- Posts
- 1,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Nov 25, 2008, 16:42 #10
- Join Date
- Mar 2008
- Location
- United Kingdom
- Posts
- 1,285
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Wicked. Thank you. Will let you know 9am GMT how successful it was
Thanks again.
-
Nov 25, 2008, 17:33 #11
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
Which alternative to UTF would you suggest should have been used to define a characterset to hold the hundreds of thousands of different characters where the most commonly used ones can fit in one byte, the next most commonly used in two bytes, and the least used in four bytes?
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Nov 25, 2008, 17:37 #12
-
Nov 25, 2008, 17:44 #13
- Join Date
- Apr 2007
- Posts
- 1,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I don't concern myself with the inner workings of character sets at all, to be quite honest. If I see random characters in my text editor and/or Web page that I didn't type myself and then discover that they go away when I change character sets, that is what I do. That done, I forget about the annoying distraction and get on with whatever it was I was doing. I am simply not interested in making things more complicated than they have to be.
Bookmarks