CodeIgniter Forums

Full Version: Strange Characters appearing on web pages - Solution
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Jay Turley[/eluser]
They look a lot like this: 

After much research, the solution was to make sure all of my files, and I mean ALL of them were encoded as UTF-8 without BOM.

Hoping this helps someone else solve this easily.

El Forum

[eluser]charlie spider[/eluser]
if your data is being pulled from a database, make sure your encoding for the db and the tables matches that in your config file as well as your page encoding. I had a similiar problem that wouldn't go away until absolutely EVERYTHING was using UTF-8

El Forum

[eluser]Phil Sturgeon[/eluser]
You can use htmlspecialchars() to make sure characters are encoded properly too. Remember if a:

Code:
&

shows on a page instead of...

Code:
&

then it is not valid. Similar characters will show wrong in FF.

El Forum

[eluser]krif[/eluser]
Thanks so much, I had exactly the same problem.

The strange  characters showed up before an embedded load view and I had no clue where they came from.

One of my .php files was saved with ANSI encoding. Saving it again with UTF-8 solved this issue.

El Forum

[eluser]XORd[/eluser]
yes, but should all framework files be UTF-8 w/o BOM?
cuz i see they aren't....