Since I began using UltraEdit as a programming text editor recently, I lost the ability to call the header() function in PHP. Every time I tried it in a script, the following error happened: "Cannot modify header information - headers already sent."

This error happens whenever a script produces output before header() is called. When obvious causes for this problem have been ruled out, you must look for anything that might output a blank line or other characters.

In my case, UltraEdit put three characters at the beginning of a UTF-8 file without displaying them in the editor, so I didn't spot them until I opened one of the errant scripts in vi.

These characters are a byte-order marker, as described in the UltraEdit support forum, and here's how to turn this feature off:

  1. Choose Advanced, Configuration. The General tab should be in the front.
  2. Scroll down to the Load/Save/Conversions section.
  3. Deselect the two Write UTF-8 checkboxes.

There's a possibility I've incurred the wrath of the Unicode gods by making this change, but at least my PHP scripts work.

-- Rogers Cadenhead

Comments

hi, how do you ensure that the files you open will be opened in the utf8 mode? if there are no BOM bytes, UE does not know that the file is in utf8

the documentation claims it should know it by the 2byte characters used in the file or a "charset=UTF-8" string, but the first does not work and the second requres putting the string into every file

I also foud a way how to open every file in utf8 mode: creating a conversion macro and assigning it to run on every load, but that way I cant work with non-utf8 files


 

Eclipse PHP does that a lot too, its really annoying. I spent an hour debugging before i figured it out


 

Add a Comment

These HTML tags are permitted: p, b, i, a, and blockquote. A comment may not include more than three links. Participants in this discussion should note the site's moderation policy.