0

I am building a site and for the life of me can not tell how this character (shows Unicode symbol for invalid codepoint) is being prepended to some (articles) of my pages (before the doctype).

I have searched through the site's program flow and haven't found anything. There is only one echo, which echoes the request's response after sending headers.

I am using Kohana 3, but I don't think it is too relevant to what I am asking (I've worked with Kohana for years and never had this, I doubt it is framework related).

I have looked at all PHP files included in my application/ folder, and they appear to be normal.

The Request::instance()->execute() is where the output is originating from in my bootstrap.php (wrapping the call with echos proved this). The articles.php controller has no output, and either does the model or parent controller.

What methods can I use to find this output?

alex
  • 479,566
  • 201
  • 878
  • 984

2 Answers2

2

I turned on Show Invisible Characters in my IDE (Coda) and saw this lovely, eh, red thing.

Coda

I used trusty backspace, and now it is gone! :D

I have no idea how it got there...

alex
  • 479,566
  • 201
  • 878
  • 984
1

I suspect that might be the pesky byte-order mark (as deceze says in his comment). Try saving your PHP scripts as UTF-8 without BOM and see if it helps. If you are seeing the unknown-code-point symbol that could have something to do with your pages being served as ISO-8859-1 instead of UTF-8 as well.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
  • Thanks BoltClock. I am specifying the charset as UTF-8 in the headers, so it should be good for UTF-8. I'll look into saving the files without BOM (though I am still unsure *which* file is being the pest). – alex Feb 14 '11 at 02:28
  • I'm using Coda, and looks like I can save only as UTF-8 (no option for BOM). – alex Feb 14 '11 at 02:30
  • @alex: OK I checked, Coda 1.7 saves without the BOM so that's the right way to go. I verified this by making a new PHP file, saving it, connecting to my Mac from my PC and opening the file with Notepad++ which differentiates between UTF-8 with and without the BOM. – BoltClock Feb 14 '11 at 02:36
  • @alex: It should be the same for 1.6. – BoltClock Feb 14 '11 at 02:37
  • @BoltClock So it's not a BOM issue? – alex Feb 14 '11 at 02:38
  • It isn't a BOM... the character is only one byte. – Brad Feb 14 '11 at 03:22