Hi,

I am working on my web site and I ran into a peculiar problem... it seems that UTF-8 .php is creating some layout problems for me. Is this possble?

I am creating the website in 2 version fully identical, except that one in chinese and the other in english. The one in english is in ANSI, and the chinese is in UTF-8. (not UTF-8 BOM). I use Notepad++ to type html/php directly into text files.

HOW CHANGE LANGUAGE:
1. user goes to page e.g. about.php
2. about.php check session variable for "cn" or "en"
3. Include() the page form the approperiate directory eg. cn/about.php or en/about.php
4. cn/about.php or en/about.php subsequently includes() other content from the sam directory.
5. both cn and en version share same css script in the root directoy.

PROBLEM:
With the only difference being the encoding (and the meta lang information), the cn navigation div is extra-padded.

see http://sandbox.desk.vuox.com
EDIT: this link will not show the problem until http://www.daniweb.com/forums/post1317671.html#post1317671 is solved. Please help if you can.. please please... T_T

I have solved the problem myself.

The reason is because there is another flavour of UTF-8 encoding which includes BOM (whatever that is) which adds extra byte information which will confuse the web browser and cause layout/display/text problems.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.