[solved] Byte-Order Mark found in UTF-8 File. How do i remove this?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
liudaz

[solved] Byte-Order Mark found in UTF-8 File. How do i remove this?

Post by liudaz »

Hello,

I have set up several sites on my new dedicated server and one common thing occured.
Every time when i try to validate the site through W3C, i get a warning or even errors:

" Warning Byte-Order Mark found in UTF-8 File.  The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported.
"

On one site because of that i have got even two errors. I looked up at the source of the site, and found that there is a character right infront the doctype.

How do i remove this through CMS MS? The remplates are clean..

Any suggestion? I use CMS MS  MLE v1.2.5 on linux.
Last edited by liudaz on Fri Feb 06, 2009 3:01 pm, edited 1 time in total.
MaKK0
Forum Members
Forum Members
Posts: 17
Joined: Thu Jun 05, 2008 7:59 am

Re: Byte-Order Mark found in UTF-8 File. How do i remove this?

Post by MaKK0 »

Having the same problem... someone has a solution for me? Checked the mysql db already (utf-8) page encoding is also utf-8 so im not able to "see" this hidden character.

If I change in firefox > character encoding > from utf-8 > to western iso i am able to see  before my document starts...

Hope someone has the solution. Thanks!


---------------

THINGS THAT MIGHT BE USEFUL

CMS is running in a subdirectory like this http://www.domain.tld/nl/

SYSTEM INFORMATION
PHP Effective Memory Limit (memory_limit): 32M
Maximum Execution Time (max_execution_time): 30

INSTALLED SOFTWARE
CMS Made Simple 1.4.1 "Spring Garden"

Installed Modules

CMSMailer 1.73.14
MenuManager 1.5.1
ModuleManager 1.2.1
News 2.8.2
nuSOAP 1.0.1
Search 1.5.1
ThemeManager 1.0.8
TinyMCE 2.4.5
RSS 1.1
FileManager 0.4.1
Printing 0.2.5
TruetypeText 2.0.2
FormBuilder 0.5.5
Captcha 0.3.1
tobik
Translator
Translator
Posts: 149
Joined: Thu Aug 16, 2007 6:18 pm

Re: Byte-Order Mark found in UTF-8 File. How do i remove this?

Post by tobik »

You probalby edited one or more CMSMS files with a UTF8 editor.
nhaack

Re: Byte-Order Mark found in UTF-8 File. How do i remove this?

Post by nhaack »

Yep, happened to me as well. I wrote a plug-in which was encoded UTF-8 with BOM, after converting it to UTF-8 no BOM it worked fine. I use notepad++ for such things, great editor. You can also pre-define your preferred encoding to ensure that you do not change encoding of a file by accident.

Best
Nils
MaKK0
Forum Members
Forum Members
Posts: 17
Joined: Thu Jun 05, 2008 7:59 am

Re: Byte-Order Mark found in UTF-8 File. How do i remove this?

Post by MaKK0 »

ok, great! Thanks for the replys so far.

Is there a way to find out which file I could have changed? Tried the config.php but still having the problem.
Or what do you suggest?
tomruss
New Member
New Member
Posts: 6
Joined: Thu Nov 13, 2008 7:32 pm

Re: Byte-Order Mark found in UTF-8 File. How do i remove this?

Post by tomruss »

I am having the same problem.
I ran through all the files in my cms installation and found none containing BOM characters.
Moreover I noticed that the BOM character appears only on the polish version of my site, english is fine.
Please compare the following (change the encoding/charset to some western/iso to see the BOM char)

Polish version: http://lookbook.nazwa.pl/personalstylist2/pl/home.htm
English equivalent: http://lookbook.nazwa.pl/personalstylist2/en/home.htm
(The problem persist even if I clean the template completely!)

What might be the problem here ??
Some differences in the encoding on cms/database interface ? How to check it? Where to look for a possible mistake ?

I am runnig:
1.4.1 "Spring Garden" with MLE
liudaz

Re: Byte-Order Mark found in UTF-8 File. How do i remove this?

Post by liudaz »

On several sites i had this problem and managed to solve it. Try checking the MLE trnaslation files.  Use f.e. Notepad ++ to encode to UTF without BOM. Liudas
tomruss
New Member
New Member
Posts: 6
Joined: Thu Nov 13, 2008 7:32 pm

Re: Byte-Order Mark found in UTF-8 File. How do i remove this?

Post by tomruss »

Ok, I got it!
I was the lang file in News module causing the problem.
Thanks for the tip!
liudaz

Re: Byte-Order Mark found in UTF-8 File. How do i remove this?

Post by liudaz »

Yes, so in general - ensure, that every file you edit is converted into UTF-8 without BOM. That way you should stop getting that error. I hope this helps to people, who are experiencing this issue.

Solved? :)
Post Reply

Return to “Developers Discussion”