?? |
[eluser]Tanax[/eluser]
Hi! I have an output problem/error. If I'm on the index function in a certain controller, everything works great. However, if I'm in the function called category, it outputs  before everything else(in the view!). http://img27.imageshack.us/img27/6672/codeerror.jpg Observe that this only occurs when I'm in a category that has subcategories. When I'm in a main category(a category without subs), it displays without that weird thing. Controller functions used: Code: class Product extends Controller Category model Code: class Category extends Model The "sub" view Code: <div id="cat-title"><?=$category->cat_name?></div> Again, note that the display of a maincategory is rendered completely without errors and any of those characters(so there's nothing wrong with the charset or anything like that), so my guess is that something's wrong with the sub_category-used functions either in the model, view or controller. Anyone have an idea?
[eluser]Dam1an[/eluser]
This has come up a few times, the solution seems to be to make sure ALL files are encoded as UTF-8 without BOM (Byte Order Mark) Not sure how/why that works, but it seems to
[eluser]Tanax[/eluser]
Well, this would then be.. a problem with the view file, since I've used different view files for subcategories and maincategories. How would I encode it as UTF-8??
[eluser]Tanax[/eluser]
Yep! It was encoded as UTF-8, I changed it to UTF-8 without BOM, and now it's working xD Weird error I must say.
[eluser]darri[/eluser]
I had the same problem with odd characters appearing before anything else on the page (I got ). After a good half hour of tinkering it seems that the problem lies with one or more of the codeigniter files (controller, model or view) being set to UTF8 encoding, while the header's meta tag charset was set to something else (for English it's usually iso-8859-1). The solution for me was to make sure that they were all set to the same type of encoding. So if your codeigniter files are encoded as UTF8, use a header meta tag like this: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Or if your codeigniter files are encoded as 8 Bits (I use Flash Develop + this seems to be the default alternative to UTF8), use a header meta tag like this: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> In the second case there, it might help if you save your codeigniter files as UTF8 and then save them again as 8 Bit, just to refresh the encoding. Hope that helps you, it worked for me. |
Welcome Guest, Not a member yet? Register Sign In |