473,414 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

files saved in UTF-8, PHP5 sends UTF-8 BOM ;(

R
Hi All,

I'm using UTF-8 encoding for my PHP scripts, output is also UTF-8.

all files have UTF-8 BOM: 0xEF 0xBB 0xBF at the beginning

I have PHP Version 5.1.2 on WinNT and PHP 5.1.1 on Gentoo

given code:

if (PHP_OS == 'WINNT')
{
header('Content-Type: text/plain; charset=UTF-8"');
var_dump(setlocale(LC_ALL, 'polish_Poland'));
echo mb_strtoupper("aesz", 'utf-8');
}
else
{
// this won't work BOM was sent -headers were sent
header('Content-Type: text/plain; charset=UTF-8"');
var_dump(setlocale(LC_ALL, 'pl_PL.utf8'));
echo mb_strtoupper("aesz", 'utf-8');
}

the output is:

WinNT:

string(18) "Polish_Poland.1250"
AESZ

Linux Gentoo:

Warning: Cannot modify header information - headers already sent by
(output started at /home/xh/public_html/test.php:1) in
/home/rr/public_html/test.php on line 25
string(10) "pl_PL.utf8" AESZ

mb_strtoupper works fine on both systems but what about
PHP complaining about UTF-8 BOM when trying to send headers on
Gentoo...

on WinNT I have a newer version of PHP...
is this error showing up because on Gentoo I use older PHP5?

thanks in advance for any help

best regards
R

Jul 24 '06 #1
1 2334
On 24 Jul 2006 08:55:45 -0700, "R" <ru******@poczta.onet.plwrote:
>I'm using UTF-8 encoding for my PHP scripts, output is also UTF-8.

all files have UTF-8 BOM: 0xEF 0xBB 0xBF at the beginning

I have PHP Version 5.1.2 on WinNT and PHP 5.1.1 on Gentoo
See: http://bugs.php.net/bug.php?id=22108

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: MAK | last post by:
Hello everyone, I know how to add images and icons etc to dll file. What I would like to know is there is a way to add those icons on the forms during the run time from the dll or to reference it ...
2
by: Bernd Lambertz | last post by:
I have a problem with bcp and format files. We changed our databases from varchar to nvarchar to support unicode. No problems so fare with that. It is working fine. But now I need a format...
2
by: MDW | last post by:
I’ve got a menu file that’s saved as an .shtml document. I don’t want to post the code, but essentially it’s a simple HTML table, with an XSL template wrapped around it. This way, I can...
2
by: Steve | last post by:
How do you programatically save files that are attached to an email to a specified folder? It could be one file or multiple files attached to the email. Can it be done if Outlook Express is being...
11
by: MM | last post by:
Hi I have never written any C programs before, but it seems that I need to do so now. Hope some of you out there can spend a few minutes and help me by writing a simple example of something...
3
by: WindAndWaves | last post by:
Hi Folks I am wondering if any of you has any experience with unicode files created from Access. I am using an access database to write HTML files. Now, for some of these files, I use...
2
by: Rudy | last post by:
Hello all! I have a web application, that I can upload files to a folder from the web site. The file path is stored in SQL. I have a 73GB drive, external hooked into the web server. I can load up...
3
by: simonharrison | last post by:
Hello everyone. Hopefully someone can point me in the right direction here. I'm wanting to write a script to open microsoft word and adobe pdf documents . Here is a little background: At the...
0
MMcCarthy
by: MMcCarthy | last post by:
This is a module that scans for files and folders on a specified path and describe them in comma separated values file in a text format. The information is stored in this file consecutively like:...
15
by: JoeC | last post by:
I am writing a program that I am trying to learn and save binary files. This is the page I found as a source: http://www.angelfire.com/country/aldev0/cpphowto/cpp_BinaryFileIO.html I have...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.