Page 1 of 1
Most odd thing ive ever seen
Posted: Mon Nov 05, 2007 2:19 pm
by SirChick
Ok this is most weird... my pages are all fine but i load up one of my pages and some how out of know real explanation this '£' symbol echos like '�'
Even my include for that page which echo's a £ also shows '�'.
But if i go to any other page again it goes back to '£'.
Its most strange, what sort of thing can cause this cos I don't know where to begin looking for fixing this issue... no errors occur and the scripts still work as per usual.
Any one had this problem before?
**Adittional info - its only doing it on my firefox**
Posted: Mon Nov 05, 2007 2:29 pm
by onion2k
It's a character encoding problem. The page is being served in one character set, but the data is in a different one. It usually happens because someone has inputed data with a browser set to force pages to load in a strange encoding, or if they've pasted from Word or something.
There are two possible fixes:
1. Make sure your entire tool chain is using the correct character encoding, all your data is saving in the correct character set, and your database interaction and display is in the same character set.
or
2. Use £ instead of £. str_replace them, or REPLACE() (the MySQL string function, not the 'insert/replace' syntax) in the SQL, or use htmlentities() if it'll work on the data (if it's in a multibyte encoding then it might not).
Posted: Mon Nov 05, 2007 2:42 pm
by SirChick
Ok im confused cos i didnt change any setttings and i wldnt know how to change encoding etc all i have is:
Echo '£ ';Echo$Money;
its physically hard coded so user input is not an issue.
all your data is saving in the correct character set, and your database interaction and display is in the same character set.
wouldn't this only count if it was variable containing the single char of £ ?
I restarted my pc and it worked =/ not sure what i did though lol
Posted: Mon Nov 05, 2007 3:04 pm
by onion2k
Sounds like Firefox had decided to use a different character encoding rather than autodetecting it. It does that sometimes.
Posted: Mon Nov 05, 2007 3:19 pm
by SirChick
Oh ok.. so probably just firefox loaded a bit dodgy =/