Utf8 include prints a white tab space?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tehhparadox
Forum Newbie
Posts: 18
Joined: Thu Oct 01, 2009 11:55 am

Utf8 include prints a white tab space?

Post by tehhparadox »

Hi

I've encountered this problem just now - if a php file that is encoded in utf-8 is included by another php file also encoded in utf-8, it seems to print a tab space.
Now this isn't a problem in good browsers like firefox or chrome but this tab space can really break a website layout in Internet Explorer.
I tested this out on a web host just to make sure it's not my local version of PHP that's causing the problem, and this still happens.

Does everyone else get this, and how do you overcome this?

Thanks
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Utf8 include prints a white tab space?

Post by requinix »

You're probably saving the file with the UTF-8 BOM. It's not whitespace but might look like it.

Check with your editor about whether you can save without the BOM. Probably in the Save As dialog. Otherwise just use ASCII/ANSI (unless you actually need UTF-8).
tehhparadox
Forum Newbie
Posts: 18
Joined: Thu Oct 01, 2009 11:55 am

Re: Utf8 include prints a white tab space?

Post by tehhparadox »

ahh thanks.

I do need utf-8 because I am using non-latin languages on this site.
I changed the character encoding from utf-8 to utf-8 without BOM and it seems to be fine.

Cheers
Post Reply