#25434 [Bgs]: Include command with UTF-8 file returns undefined character
| From: | moriyoshi@php.net | Date: | Mon, 08 Sep 2003 15:42:07 +0000 |
| Subject: | #25434 [Bgs]: Include command with UTF-8 file returns undefined character | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-47267@lists.php.net to get a copy of this message | ||
ID: 25434
Updated by: moriyoshi@php.net
Reported By: JanKarnik at atlas dot cz
Status: Bogus
Bug Type: *General Issues
Operating System: Win2K+iis
PHP Version: 4.3.3
New Comment:
> Hallo,
> I'm sorry I didn not found the above bug allready repored.
> What do i need is a solution of my problem.
> I need to use UTF-8, because I'm using several computes
> installed in
> various languages and the UTF-8 is the only enconding used
> everywhere.
> What would you recomend me to do with the PHP scripts?
>
> Thank you Jan Karnik.
Firstly, please DO NOT reply to the notification mail, always use this
web interface.
Secondly, this is not a right forum for that kind of question. Instead,
ask further question at the appropriate mailing list
(php-i18n@list.php.net).
As for your question, just turn off the BOM feature of your editor.
Previous Comments:
------------------------------------------------------------------------
[2003-09-08 11:15:49] moriyoshi@php.net
Most likely the included file contains UTF-8 BOM marker at the
beginning of it.
See also bug #22108.
Not a bug in PHP => bogus report.
------------------------------------------------------------------------
[2003-09-08 09:05:37] JanKarnik at atlas dot cz
Description:
------------
Include command with UTF-8 file returns undefined character.
Take a UTF-8 encoded php file with "include" or "require" command. Try
include a UTF-8 encoded text.
On the begining of the above include you'll get returned an undefined
character, shown in some browsers as a rectangle.
This character is used in windows to show that text has been UTF-8
encoded, but in all common editors (notepad...) is invisible.
Reproduce code:
---------------
bug.php:
<html><head><meta http-equiv="Content-Type"
content="text/html; charset=UTF-8"></head>
<body>
<?php
<include"./text.txt">
?><body></html>
text.txt:
SOME UTF-8 ENCODED TEXT
SOME UTF-8 ENCODED TEXT
SOME UTF-8 ENCODED TEXT
Expected result:
----------------
An unexpected chracters are returned
Actual result:
--------------
?<html><head><meta http-equiv="Content-Type"
content="text/html; charset=UTF-8"></head>
<body>
?SOME UTF-8 ENCODED TEXT
SOME UTF-8 ENCODED TEXT
SOME UTF-8 ENCODED TEXT <body></html>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25434&edit=1