Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Weird character in the output
#1

[eluser]zovar[/eluser]
I created a very simple controller for testing.
Code:
<?php

class Test extends Controller {

    public function __construct()
    {
        // load parent constructor
        parent::__construct();
    }
    
    function index()
    {
          $c = new Company();
    }
}
}

/* End of file test.php */
/* Location: ./system/application/controllers/test.php */

Then I added new model:
Code:
<?php

class Company {
}

/* End of file company.php */
/* Location: ./system/application/models/company.php */

Whenever I run this controller I have 1 weird character in the output. Chrome code viewer displays it as a tiny dot in the middle (similar to · but smaller), Firefox shows small rectangular instead. But because of this bug I can't use redirects, my ajax functions always contain this character etc.

Do you have any thoughts?
#2

[eluser]zovar[/eluser]
Also if I remove
Code:
$c = new Company();
from my index method then my output is empty.
#3

[eluser]TheFuzzy0ne[/eluser]
Then surely that means that it's something to do with your Company class, no?
#4

[eluser]zovar[/eluser]
Yes, I totally agree with you. But then I posted my Company class above. There is noting there. It's empty. In fact, I created another class from scratch, and again - this character in the output
Code:
<?php

class Test{}
#5

[eluser]zovar[/eluser]
this is the character ->
Code:

#6

[eluser]drewbee[/eluser]
A few things to try to see if it gets rid of it in your class...

-Whitespace between the opening PHP tag
- No ending php tag

Try this, and see what it does...
Code:
<?php
class Test {}
?>
#7

[eluser]zovar[/eluser]
Nope. Same problem. Tried also this:
Code:
<?php class Test{} ?>
#8

[eluser]pistolPete[/eluser]
How are you saving your files?
Try UTF-8 without BOM.
#9

[eluser]TheFuzzy0ne[/eluser]
What editor are you using to edit the code? You need to ensure that all files are encoded as UTF-8 without [url="http://en.wikipedia.org/wiki/Byte-order_mark"]BOM[/url]

EDIT: D'oh!
#10

[eluser]zovar[/eluser]
This is so embarrassing. I am using Notepad++ on Windows.

Yes, after changing format of both files to 'Encode in UTF-8 without BOM' this dot disappeared.

Thanks a lot!




Theme © iAndrew 2016 - Forum software by © MyBB