Link to home
Start Free TrialLog in
Avatar of youdontmeanmuch
youdontmeanmuchFlag for United States of America

asked on

Eclipse UTF8 without BOM (Byte order Mark)

I'm using Eclipse along with the PDT plugin (php development tools) and PHP or Apache doesn't play nice with UTF8 unless there is not BOM (Byte order Mark).

This makes no sense because i don't see an option in eclipse workspace preferences to set UTF8 WITHOUT BOM. only UTF8 (BOM)

Does anybody know how i can set eclipse to use UTF8 without BOM? This has been bugging me for a long time now, HELP :(
Avatar of Adrian Pop
Adrian Pop
Flag of Sweden image


Look here:
https://www.experts-exchange.com/questions/22675765/PHP-UTF-8-encoded-file-problem.html
and here:
http://bugs.php.net/bug.php?id=22108

It seems that this is a bug in PHP. You could start php with:
--enable-zend-multibyte

Also, you can specify the encoding of php files from Eclipse.
See the attached image. You reach that via:
Window->Preferences->General->Content Types
Select Text in the right part, Select PHP Content Type.
Select all files, and write in the Default Encoding field at the bottom: UTF8.

Cheers,
za-k/
Eclipse-PHP-Encoding.JPG
Avatar of youdontmeanmuch

ASKER

I know how to change the character encoding. Its just that the encoding that i'm looking for doesn't seem to exist. For example in other text editors like notepad++ and ultra edit will allow you to save utf-8 files with or without BOM. I'm guessing this option isn't available in eclipse, anybody know of a workaround or plugin?
ASKER CERTIFIED SOLUTION
Avatar of Adrian Pop
Adrian Pop
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forced accept.

Computer101
EE Admin