Re: Hebrew in php



BJY wrote:

Benjamin Esham wrote:

Can you show us the beginning of header.inc? And possibly a hex dump of
the first line or so? If your file contains a Unicode byte order mark
[1], those are probably the characters messing your file up.

The hex dump of the output indeed shows 'junk' which i don't know where it
comes from: EF BB BF EF BB BF EF BB BF 3C 48 54 4D 4C ... where the 3C
indicates the start of the <HTML tag

Any idea what makes PHP spit out this at the start of output?

I think I've found your problem. From [1]:

| Quite a lot of Windows software (including Windows Notepad) adds one to
| UTF-8 files. However in Unix-like systems (which make heavy use of text
| files for configuration) this practice is not recommended, as it will
| interfere with correct processing of important codes such as the hash-bang
| at the start of an interpreted script. It may also interfere with source
| for programming languages that don't recognise it. For example, [...] in
| PHP, if output buffering is disabled, it has the subtle effect of causing
| the page to start being sent to the browser, preventing custom headers
| from being specified by the PHP script. The UTF-8 representation of the
| BOM is the byte sequence EF BB BF.

It looks like the phantom "EF BB BF" bytes are Unicode BOMs. (Why there are
three of them I have no idea.)

Are you using Notepad? If so, I recommend you use a different editor; if
not, see if there's an option to turn off the inclusion of the BOM. If
you're looking for a new editor, I recommend Vim [2], which has great
support for bidirectional text editing, although it does have a rather steep
learning curve. You might check out the comp.editors group if you have any
further questions about text editing and editors.

[1] http://en.wikipedia.org/wiki/Byte_Order_Mark
[2] http://www.vim.org

HTH!
--
Benjamin D. Esham
bdesham@xxxxxxxxx | AIM: bdesham128 | Jabber: same as e-mail
"Whenever a theory appears to you as the only possible one, take
this as a sign that you have neither understood the theory nor
the problem which it was intended to solve." — Karl Popper

.



Relevant Pages

  • Freeware UTF8 capable editor?
    ... I could make it myself using unicode controls.. ... But for quick testing, can anyone here recommend ... a text editor where I can choose to open UTF8 encoded ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Typography of programs
    ... There is no reason to introduce 6 characters (probably more: ... We should be able to format commentary text as in a simple ... using a text editor that is in general ... If that editor handles Unicode, fine, but I ...
    (comp.lang.c)
  • Re: Empfehlung fuer Linux-Einsteigerseite?
    ... ich keinen Editor mehr anfassen, der nicht mit UTF-8 umgehen kann. ... fuer Config files magst du Recht haben. ... dass Umlaute nirgends "einfach so" funktionieren. ... Schon Unicode ist nicht immer UTF8 und selbst UTF8 hat ASCII nicht ...
    (de.comp.os.unix.linux.misc)
  • Re: Trouble importing foreign language accents into Access 2003
    ... Unicode file. ... to only a field that has the accents, and I save it first in UTF-8, then ... I have also tried UTF-16, with and without BOM. ...
    (microsoft.public.access.externaldata)
  • Re: Setting dynamically the Greek charset in Firefox ?
    ... Greek characters required more than 1 byte in UTF-8 and assumed they ... Unicode is a set of character maps and UTF-8 ... copy-pasted in a UTF-8 editor. ...
    (comp.lang.javascript)