php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22778 include() doesn't work well under UTF-8 or UNICODE
Submitted: 2003-03-18 21:44 UTC Modified: 2003-03-19 04:22 UTC
From: meteorlet at sjtu dot edu dot cn Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.1 OS: Win2000 Server
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: meteorlet at sjtu dot edu dot cn
New email:
PHP Version: OS:

 

 [2003-03-18 21:44 UTC] meteorlet at sjtu dot edu dot cn
If I want to include a PHP file of UTF-8 coding,the control characters EF BB BF will apear in the response web.For example:
// const.php UTF-8 textformat
<?php
  define("SJTU","Shanghai Jiaotong University");
?>
// test.php
<html>
<body>
<?php
    include("const.php");//the result is a non-print character: 
?>
</body>
</html>

But when I save const.php as UNICODE,the result is:
<html>
<body>
? ? p h p 
 
     d e f i n e ( " S J T U " , " S h a n g h a i   J i a o t o n g   U n i v e r s i t y " ) ; 
 
 ? > </body>
</html>

Only in the case of ANSI coding,include() can work well.PHP can work well with ANSI,UTF-8,UNICODE,but why doesn't Include() support UTF-8,UNICODE?Is it a bug?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-19 04:22 UTC] moriyoshi@php.net
Duplicate of bug #22108
Please add your further comments at that report.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 26 12:00:02 2025 UTC