Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #17861

Re: Twice UTF-8 byte-order mark (BOM)

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: Twice UTF-8 byte-order mark (BOM)
Date Sat, 5 Jan 2019 11:04:55 +0100
Lines 33
Message-ID <g9bdq7Fte1U1@mid.individual.net> (permalink)
References <82a7cd23-82be-4611-a691-e0edcf8c30d6@googlegroups.com> <241220181649060212%timstreater@greenbee.net> <5c212055$0$22357$e4fe514c@news.xs4all.nl> <g8grh2F7644U1@mid.individual.net> <g8hi7sFbu8nU2@mid.individual.net> <34632309-6e9e-49c5-9123-c947347b789e@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net wsOPfvWD6owSGr7HUKgVrgTG/+joOhx8PtCNS2BvTeJIxCK9K4
Cancel-Lock sha1:hBOJDN43GSjqo4HKiPzA2GrQ3kg=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3
In-Reply-To <34632309-6e9e-49c5-9123-c947347b789e@googlegroups.com>
Content-Language en-GB
Xref csiph.com comp.lang.php:17861

Show key headers only | View raw


On 1/4/19 5:29 PM, vfhhutt45hghjjdewrghb@gmail.com wrote:
> Am Mittwoch, 26. Dezember 2018 15:41:06 UTC+1 schrieb J.O. Aho:
>> As long as it begins with <?php it will not output anything, but the BOM
>> is put before the <?php and so you will have output which is outside the
>> php engines control.
>>
> 
> I understand the modus operandi but I think it's not a good way. UTF-8 should be used as a norm. And the BOM is part of a UTF-8 file. In other cases (without BOM) it is a ISO 8859-1 file or anything else.

The BOM was just an addition for issues in some lesser operating 
systems, in newer versions like UTF-16 BOM has been removed from the 
standard.


> I'm wondering that not everybody have my problems. To include the DB conneting data is a normal procedure for security reasons and for usability.

Not everyone uses a lesser OS and have BOM enabled in text editors.


> Maybe php should filter the BOM if "include" is used?!

PHP do not know what your intention is with the file, say you are 
generating some data inside a UTF-8 BOM document, then you don't want it 
to be stripped.

Just do the sensible thing and say no to BOM as there are other ways to 
identify your file as UTF-8, and if you don't use UTF-8 characters in 
your text, then it's just plain ASCII and has no use of BOM in anyway.


-- 

  //Aho

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Twice UTF-8 byte-order mark (BOM) vfhhutt45hghjjdewrghb@gmail.com - 2018-12-24 08:39 -0800
  Re: Twice UTF-8 byte-order mark (BOM) Tim Streater <timstreater@greenbee.net> - 2018-12-24 16:49 +0000
    Re: Twice UTF-8 byte-order mark (BOM) Luuk <luuk@invalid.lan> - 2018-12-24 19:07 +0100
      Re: Twice UTF-8 byte-order mark (BOM) "J.O. Aho" <user@example.net> - 2018-12-24 20:54 +0100
        Re: Twice UTF-8 byte-order mark (BOM) Luuk <luuk@invalid.lan> - 2018-12-24 21:15 +0100
      Re: Twice UTF-8 byte-order mark (BOM) Arno Welzel <usenet@arnowelzel.de> - 2018-12-26 09:13 +0100
        Re: Twice UTF-8 byte-order mark (BOM) Luuk <luuk@invalid.lan> - 2018-12-26 12:41 +0100
          Re: Twice UTF-8 byte-order mark (BOM) Arno Welzel <usenet@arnowelzel.de> - 2018-12-26 15:32 +0100
        Re: Twice UTF-8 byte-order mark (BOM) "J.O. Aho" <user@example.net> - 2018-12-26 15:41 +0100
          Re: Twice UTF-8 byte-order mark (BOM) vfhhutt45hghjjdewrghb@gmail.com - 2019-01-04 08:29 -0800
            Re: Twice UTF-8 byte-order mark (BOM) Richard Damon <Richard@Damon-Family.org> - 2019-01-04 21:08 -0500
            Re: Twice UTF-8 byte-order mark (BOM) "J.O. Aho" <user@example.net> - 2019-01-05 11:04 +0100
              Re: Twice UTF-8 byte-order mark (BOM) Richard Damon <Richard@Damon-Family.org> - 2019-01-05 11:26 -0500
                Re: Twice UTF-8 byte-order mark (BOM) Tim Streater <timstreater@greenbee.net> - 2019-01-05 16:33 +0000
                Re: Twice UTF-8 byte-order mark (BOM) Luuk <luuk@invalid.lan> - 2019-01-05 19:34 +0100
                Re: Twice UTF-8 byte-order mark (BOM) Tim Streater <timstreater@greenbee.net> - 2019-01-05 19:08 +0000
                Re: Twice UTF-8 byte-order mark (BOM) Luuk <luuk@invalid.lan> - 2019-01-06 20:25 +0100

csiph-web