[PHP] Please help to unsubscribe

2011-08-27 Thread Eli Orr
The advised email to unsubscribe does not work: 
php-general-unsubscr...@lists.php.net

Thanks

Eli



-- 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Ftp upload

2011-06-14 Thread Eli Orr (Office)

Dear Experts,

Can you please advise how can I detect a string if it is UTF-8 or now 
and how can I if possible

convert a string to a utf-8 ?

Here's the string I got from client - client sends it via POST with 
urlencode and does apply UTF-8

encoding on the string.

Here's the string I got:   
However I do not get the string as a utf-8 (After I do urldecode to the 
client POST parameter)


Please advise

Eli


[PHP] PHP to Java integration using : shell_exec function

2011-05-26 Thread Eli Orr (Office)


Hi,

Please advise if the following is possible and how can pass parameters 
from the PHP to the Java application.


Thanks.

Here's my script draft:

 // The XML_toEnc 
is a string and shall be urlencoded !
  $EncXML = shell_exec(""/usr/bin/java/java -jar MyApp.jar -XML 
<$XML_toEnc>); <<== ??? How can I pass parameters like a large string of 
let say XML?


echo  $EncXML; // back to the MObile Client

// Receiving client shall:
//  urldecode the string


?>


Eli Orr


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How can a UTF-8 string can be converted to an array of Bytes?

2011-05-25 Thread Eli Orr (Office)

Hi,

Since a UTF-8 is a multi-bytes mechanism I get for 2 or 3 bytes  UTF-8 
encoded character a single character


How can it be break into the REAL bytes array that represent the UTF-8 
string

 and how  can we reassembled the bytes array  back to UTF-8?

--
Best Regards,

*Eli Orr*
CTO & Founder
*LogoDial Ltd.*

__


[PHP] GnuPG from PHP - Where is the include ??

2011-05-24 Thread Eli Orr (Office)
Please advise - I'guess it is not a build in and looking for the GnuPG 
PHP include as

all the GnuPG functions are now considered undefined.

See below.

Thanks

Eli

//  GnuPG from PHP - Where is the include ??
//  http://www.gnupg.org/gph/en/manual.html
//  http://www.gnupg.org/documentation/howtos.en.html
//  GnuPG allows to encrypt and sign your data and communication,
//  features a versatile key management system as well as access
//  modules for all kinds of public key directories.
//

echo "GNU Encrypt with agreed secret key between sides.";

$secret_key = "8660281B6051D071D94B5B230549F9DC851566DC"; // Only shared 
parties know this
$the_secret_content  = "this is a very secret XML keep the secret key in 
the server and client well hidden from 4rd parties"; // Only shared 
parties know this


echo "Secret Key between Parties: [$secret_key] ";
echo "The sensitive content to keep safe 
 from 3rd parties:  $the_secret_content ";


//Creating the encryption content
$res = gnupg_init();
gnupg_addencryptkey($res, $secret_key);
$enc = gnupg_encrypt($res, $the_secret_content);
echo "This is the sensitive content encrypted by strong shared secret 
key:[".$enc."] ";


echo "Secret Key between Parties: [$secret_key] ";

 $res = gnupg_init();
gnupg_adddecryptkey($res,$secret_key);
$plain = gnupg_decrypt($res, $enc);

echo "This is the sensitive content decrypted by recieving party 
 that has the shared secret key:[".$plain."] ";

_

_


Re: [PHP] Check the byte sequence of a file to tell if it is UTF-8 without the BOM using PHP ?

2011-05-22 Thread Eli Orr (Office)

Thank you Peter.

Can you please advise if

mb_detect_encodin does detect the file type by its structure / content?

Thanks

Eli

 


On 22/05/2011 10:12, Peter Lind wrote:

On 22 May 2011 09:03, Eli Orr (Office)  wrote:

Dear Peter,

But my point was different.

If you DO NOT have any BOM of a File does

mb_detect_encodin

can detect the file type by scanning the whole file ??


A few points:
1. top-posting on this list is frowned upon. Please bottom-post.
2. I did not write anything about BOM as far as I can recall. Neither
does the page I linked to contain much about BOM (I really suggest
reading it - as pointed out, the first comment should help you)

Regards
Peter




--
Best Regards,

*Eli Orr*
CTO & Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: _Eli.Orr@LogoDial.com_
Skype: _eliorr.com_


Re: [PHP] Check the byte sequence of a file to tell if it is UTF-8 without the BOM using PHP ?

2011-05-22 Thread Eli Orr (Office)

Dear Peter,

But my point was different.

If you DO NOT have any BOM of a File does

mb_detect_encodin


can detect the file type by scanning the whole file ??

Thanks

Eli

On 22/05/2011 09:53, Peter Lind wrote:

On 22 May 2011 08:17, Eli Orr (Office)  wrote:

Hi Adam,

I have a prof that the XML advise does not work in real cases I had.
We are using XMLs in our system but when you edit the XML with  a text
editor and put the XML heading of UTF-8


it DOES NOT assure the text inside is encoded in UTF-8 so but maybe (many
cases) t other iso-xxx method.

The point of the header is telling readers what encoding is used. Of
course that means errors are possible - setting the header is not
magic, it doesn't change the rest of the file. You need to make sure
the contents of the file match the encoding from the header when you
make XML documents.

Anyway, from your perspective, the header is an indication but not a
foolproof way of figuring encoding out.


My question was for a function that scan the bytes of the file and decided
WITHOUT the BOM heading.
I mean by checking the bytes sequence in the file.

I claim that WITHOUT a BOM it might be impossible to assure it is UTF-8
encoding which is a whole escape sequence logic
that may convert one character into one, two or three character.

http://se.php.net/manual/en/function.mb-detect-encoding.php - the
first comment should be interesting to you.

*
If you try to use mb_detect_encoding to detect whether a string is
valid UTF-8, use the strict mode, it is pretty worthless otherwise.




Regards
Peter




--
Best Regards,

*Eli Orr*
CTO & Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: _Eli.Orr@LogoDial.com_
Skype: _eliorr.com_


Re: [PHP] Check the byte sequence of a file to tell if it is UTF-8 without the BOM using PHP ?

2011-05-21 Thread Eli Orr (Office)

Hi Adam,

I have a prof that the XML advise does not work in real cases I had.
We are using XMLs in our system but when you edit the XML with  a text 
editor and put the XML heading of UTF-8



it DOES NOT assure the text inside is encoded in UTF-8 so but maybe 
(many cases) t other iso-xxx method.


My question was for a function that scan the bytes of the file and 
decided WITHOUT the BOM heading.

I mean by checking the bytes sequence in the file.

I claim that WITHOUT a BOM it might be impossible to assure it is UTF-8 
encoding which is a whole escape sequence logic

that may convert one character into one, two or three character.

Any advise if I'm right on this or smart file scan function that makes it?

Eli
On 21/05/2011 20:03, Adam Richardson wrote:
On Sat, May 21, 2011 at 12:10 PM, Eli Orr (Office) 
mailto:eli@logodial.com>> wrote:



Dear PHP Gurus,

I have a debate on the following please let me know what is true /
false.

I'am using a PHP function *is_UTF_8_file ($file_name) *that I've
found as part of my PHP 5.3 installation.
This function checks if the file start with the 3 UTF-8 BOM bytes.

However another guy told me that there is way to detect if a file
is a UTF-8 without having the BOM at the file start.
To me it sounds impossible since if you do not have this
indication you have a stream of bytes that you can never tell 100%
if that is UTF-8 or else.

Who is rigt here ?
If there is a Magical function that can detect files without a BOM
if they are UTF-8 or not please share you knowledge if this
is not a "NULL" or impossible function as I thought.


Here's a great write-up I've got bookmarked (he points out Windows 
Notepad automatically determines the encoding):

http://codesnipers.com/?q=node/68

* If it's an XML file, the structure allows you determine the
  encoding.
* For other files, you can encode it as UTF-8 and look for
  improper encodings.


As far as a PHP function that already does this, I'm not aware of it, 
but you could make a system call to "file" if your on Linux, as it 
tries to automatically determine the encoding:

http://linux.die.net/man/1/file

Adam

--
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com



--
Best Regards,

*Eli Orr*
CTO & Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: _Eli.Orr@LogoDial.com_
Skype: _eliorr.com_


[PHP] a Debate here - How can you check a if a file is a UTF-8 without the BOM using PHP ?

2011-05-21 Thread Eli Orr (Office)


Dear PHP Gurus,

I have a debate on the following please let me know what is true / false.

I'am using a PHP function *is_UTF_8_file ($file_name) *that I've found 
as part of my PHP 5.3 installation.

This function checks if the file start with the 3 UTF-8 BOM bytes.

However another guy told me that there is way to detect if a file is a 
UTF-8 without having the BOM at the file start.
To me it sounds impossible since if you do not have this indication you 
have a stream of bytes that you can never tell 100% if that is UTF-8 or 
else.


Who is rigt here ?
If there is a Magical function that can detect files without a BOM if 
they are UTF-8 or not please share you knowledge if this

is not a "NULL" or impossible function as I thought.

Many thanks for you wise advise.

--
Best Regards,

*Eli Orr*
*LogoDial Ltd.*
Email: _Eli.Orr@LogoDial.com_
Skype: _eliorr.com_


Re: [PHP] Sending Email via SMTP account using PHP

2011-05-18 Thread Eli Orr (Office)

Thanks Daniel!

It works perfect.

Eli

On 18/05/2011 17:47, Daniel Brown wrote:

On Wed, May 18, 2011 at 03:17, Eli Orr (Office)  wrote:

Hi,
I'm looking for a good example for using a real SMTP account to send email
from,
such as serv...@somai.com where there is a user&  password and smtp server
available.

Please advise with a good example to reuse,

 Try this:

 http://links.parasane.net/boqp






--
Best Regards,

*Eli Orr*
CTO & Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: _Eli.Orr@LogoDial.com_
Skype: _eliorr.com_


[PHP] Sending Email via SMTP account using PHP

2011-05-18 Thread Eli Orr (Office)


Hi,
I'm looking for a good example for using a real SMTP account to send 
email from,
such as serv...@somai.com where there is a user & password and smtp 
server available.


Please advise with a good example to reuse,

Thanks

Eli

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How to enable UTF-8 Subject String ? Only Body is set ok

2011-05-17 Thread Eli Orr (Office)

Hi,

I'm trying to enable a whole Email as UTF-8 - The Body is OK but the 
Subject remains ANSI - Please help


  $headers = "From:$from". "\r\n" .
   "Reply-To:$from" . "\r\n" .
   "*Content-type:text/html;charset=utf-8;"*."\r\n" .
           "X-Mailer: PHP/".phpversion();



--
Best Regards,

*Eli Orr*
CTO & Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: _Eli.Orr@LogoDial.com_
Skype: _eliorr.com_


Re: [PHP] How to DUMP $_POST parameters to a log file? Very useful and missing in the php.net

2011-05-08 Thread Eli Orr (Office)

Thanks. Great! It works so well !

On 08/05/2011 15:01, Peter Lind wrote:

On May 8, 2011 1:57 PM, "Eli Orr (Office)"  wrote:


Dear PHP Gurus,

I need dump a $_POST parameters as part of debug process with a client.
Any know service to make this ?

I know $_POST is an Array but I look for a service function  that can save

the parsed array into a file.

let say :

$stt = save_POST_into_file ($_POST, $fp);


file_put_contents($filename, print_r($array, true));

Regards




--
Best Regards,

*Eli Orr*
CTO & Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: _Eli.Orr@LogoDial.com_
Skype: _eliorr.com_


[PHP] How to DUMP $_POST parameters to a log file? Very useful and missing in the php.net

2011-05-08 Thread Eli Orr (Office)


Dear PHP Gurus,

I need dump a $_POST parameters as part of debug process with a client.
Any know service to make this ?

I know $_POST is an Array but I look for a service function  that can 
save the parsed array into a file.

let say :

$stt = save_POST_into_file ($_POST, $fp);


Any idea ?


--
Best Regards,

*Eli Orr*
CTO & Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: _Eli.Orr@LogoDial.com_
Skype: _eliorr.com_


Re: [PHP] Improve server HTTP GET server response - HTTP 1.1 ?

2011-04-26 Thread Eli Orr (Office)


Dear Ash,

I could not follow on how it can be faster using your advise.
Seems you focus on how it could be slower using a random suffix each 
call to assure no caching is involved.


Any practical advise or references/example how to make it faster for the 
initial call ?

Any methods from the enhanced HTTP of V1.1 ?

Thanks

Eli


On 26/04/2011 21:00, Ashley Sheridan wrote:

On Tue, 2011-04-26 at 12:37 +0300, Eli Orr (Office) wrote:

Dear PHP Gurus,

I have wrote a service that respond to a client HTTP GET request with
BLOB of data:
http://mimmage.com/cms/client_initialize1.php?OPERATOR=MIRS&ID=23412341234&OS=RIM  
<http://mimmage.com/cms/client_initialize1.php?OPERATOR=MIRS&ID=23412341234&OS=RIM>

The first time I call the HTTP GET it works very slow.. next calls it
works much faster.
Please advise how can I enhance the server response in the first call.
Any method for the client to initialize a standby like service with the
server ahead of the specific request ?

Is there any way HTTP 1.1 operation fashion can speed it up ?
e.g.http://www8.org/w8-papers/5c-protocols/key/key.html

Looking forward for your wise and experienced advise for this heavy issue.

Thanks

Eli
eliorr.com




Could it be that there is some mechanism which is caching the response 
(which is fine for GET requests as they are intended to be cached) on 
the server?


Caching can be done in PHP (a lot of frameworks contain rudimentary 
caching functionality) or by Apache itself, so there are a few places 
you can check. To test for caching, have the client-side part of the 
request add a random suffix like ?t=timestamp so that the server 
thinks this request is unique. If each request comes back slow, it's 
likely that the subsequent ones being faster is the result of caching.


--
Thanks,
Ash
http://www.ashleysheridan.co.uk





--
Best Regards,

*Eli Orr*
CTO & Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: _Eli.Orr@LogoDial.com_
Skype: _eliorr.com_


[PHP] Improve server HTTP GET server response - HTTP 1.1 ?

2011-04-26 Thread Eli Orr (Office)

Dear PHP Gurus,

I have wrote a service that respond to a client HTTP GET request with 
BLOB of data:

http://mimmage.com/cms/client_initialize1.php?OPERATOR=MIRS&ID=23412341234&OS=RIM

The first time I call the HTTP GET it works very slow.. next calls it 
works much faster.

Please advise how can I enhance the server response in the first call.
Any method for the client to initialize a standby like service with the 
server ahead of the specific request ?


Is there any way HTTP 1.1 operation fashion can speed it up ?
e.g.  http://www8.org/w8-papers/5c-protocols/key/key.html

Looking forward for your wise and experienced advise for this heavy issue.

Thanks

Eli
eliorr.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] $_POST vars

2011-04-13 Thread Eli Orr
Hi Jim, 

Sure you can create set of et of $_POST vars :

e.g. 



 


So that  admin_code var is passed to myphpaction.php as post and shall be
access there via  $_POST["admin_code "]; 
However, note that in PHP all the output buffer is flushed actually,
ONLY after the script execution is  terminated. 

Skype:  eliorr.com


-Original Message-
From: Jim Giner [mailto:jim.gi...@albanyhandball.com] 
Sent: Wednesday, April 13, 2011 8:50 PM
To: php-general@lists.php.net
Subject: [PHP] $_POST vars

Can one create a set of $_POST vars within a script or is that not do-able? 
My display portion of my script utilizes the POST array to supply values to
my input screen - this works well for the first display of an empty screen,
and any following re-displays if there's an error in the user's input.  But
I want to use this same script/screen to display the results of a query when
the user wants to update an existing record. 



--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr
Hi Richard, 

Thanks. 
I've already got a solution to simply use Notes++ and save the PHP script 
with Save As encoding set to ANSI (It was UTF-8 indeed that creates the BOM...).

Thanks again

Eli

-Original Message-
From: Richard Quadling [mailto:rquadl...@gmail.com] 
Sent: Tuesday, April 12, 2011 2:59 PM
To: Eli Orr
Cc: php-general@lists.php.net
Subject: Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile 
App

On 12 April 2011 12:50, Richard Quadling  wrote:
> On 12 April 2011 11:59, Eli Orr  wrote:
>>
>> Hi Richard,
>>
>> Thanks.
>> Indeed, that is the case - I've included a code that has UTF-8 string 
>> contants -so I guess the PHP parser set the UTF-8 mode to ON so that the 
>> returned string to the client has the UTF-8 BOM.
>>
>> It is not a big issue as the mobile app guys aware of this and make the 
>> proper 3 bytes offset.
>> Anyhow I was looking for a service to control that behaviour.
>>
>>  Thanks
>>
>> Eli
>>
>> -Original Message-----
>> From: Richard Quadling [mailto:rquadl...@gmail.com]
>> Sent: Tuesday, April 12, 2011 12:45 PM
>> To: Eli Orr
>> Cc: php-general@lists.php.net
>> Subject: Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to 
>> a Mobile App
>>
>> 2011/4/12 Eli Orr :
>>> Dear PHP Gurus,
>>>
>>> I would like to Eliminate the 3 UTF-8 BOM enforced on my returned BLOB:
>>>
>>> The PHP server adds  utf-8 BOM (UTF-8 Byte Order Mark  - in the 
>>> beginning of
>>> UTF-8  files) which
>>> consists of three bytes: EF BB BF.
>>>
>>> The Mobile App served by the server Does not need that. How can I 
>>> eliminate it??
>>>
>>> Thanks.
>>>
>>> UTF-8 Byte Order Mark – BOM:
>>> http://unicode.org/faq/utf_bom.html#BOM
>>>
>>> Best Regards,
>>>
>>> Eli  Orr
>>> CTO & Founder
>>> Mimmage.com
>>> My virtual vCard
>>> LogoDial Ltd.
>>> M:+972-54-7379604
>>> O:+972-74-703-2034
>>> F: +972-77-3379604
>>>
>>> Plaut 10, Rehovot, Israel
>>> Email:   eli@logodial.com
>>> Skype:  eliorr.com
>>>
>>>
>>> -
>>>
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
>>> http://www.php.net/unsub.php
>>>
>>>
>>
>> Can you show us the PHP script that DOES output the BOM?
>>
>> Normally, PHP doesn't do this automatically (AFAIK). The main reason being 
>> is that it is often the case that the BOM appears in the source code file 
>> before the > example).
>>
>> If a BOM is being issued by PHP, it is being done programmatically, or is 
>> being missed due to the initial source code file having the BOM set.
>>
>> See http://docs.php.net/manual/en/function.session-start.php#102431,
>> http://docs.php.net/manual/en/function.header.php#95864, etc.
>>
>> Now. Having said all of that, you may find you are using some sort of output 
>> buffering and that is setting the BOM after the headers are sent.
>>
>> But, as it stands, PHP will not be generating the BOM for you.
>>
>> --
>> Richard Quadling
>> Twitter : EE : Zend
>> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>>
>> --
>> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
>> http://www.php.net/unsub.php
>>
>>
>>
>
> No. The parser does not _ADD_ the BOM.
>
> The bom already exists in your source code. Nothing to do with PHP.
>
> The file you included that has the UTF-8 constants has the BOM.
>
> You need to edit that file and remove the BOM. The actions you need to 
> take will depend upon your editor.
>
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>

To be a bit more specific...

The BOM is the 3 bytes you correctly identified earlier.

Most editors won't show these when you edit the files.

But, for the sake of argument, let's just pretend they are visible and look 
like ...

#@&

In the php script that contains some UTF-8 constants, the file would look like 
...

#@&

As PHP will only actually parse the content between , the #@& 
string (the BOM) is simply sent straight through to the web server
-> the client with no interruption.

Now, if your code was ...

#@&

you would see the headers already sent error message, as the BOM tells the 
webserver that data is now being received and to send any headers it already 
has.

So when the session_start() wants to send the session cookie (which is done as 
a HTTP Header), PHP already knows some content has gone (the
BOM) and reports the error.

To iterate, PHP is NOT generating the BOM. You already did that in your code. 
Well, the editor did it for you.

Ideally, you want to turn off the BOM in your editor.

--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr


Thanks Richard, 

Do you know a technique to mirror all the echo strings into a file for 
debugging ?

Eli

-Original Message-
From: Richard Quadling [mailto:rquadl...@gmail.com] 
Sent: Tuesday, April 12, 2011 2:51 PM
To: Eli Orr
Cc: php-general@lists.php.net
Subject: Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile 
App

On 12 April 2011 11:59, Eli Orr  wrote:
>
> Hi Richard,
>
> Thanks.
> Indeed, that is the case - I've included a code that has UTF-8 string 
> contants -so I guess the PHP parser set the UTF-8 mode to ON so that the 
> returned string to the client has the UTF-8 BOM.
>
> It is not a big issue as the mobile app guys aware of this and make the 
> proper 3 bytes offset.
> Anyhow I was looking for a service to control that behaviour.
>
>  Thanks
>
> Eli
>
> -Original Message-
> From: Richard Quadling [mailto:rquadl...@gmail.com]
> Sent: Tuesday, April 12, 2011 12:45 PM
> To: Eli Orr
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a 
> Mobile App
>
> 2011/4/12 Eli Orr :
>> Dear PHP Gurus,
>>
>> I would like to Eliminate the 3 UTF-8 BOM enforced on my returned BLOB:
>>
>> The PHP server adds  utf-8 BOM (UTF-8 Byte Order Mark  - in the 
>> beginning of
>> UTF-8  files) which
>> consists of three bytes: EF BB BF.
>>
>> The Mobile App served by the server Does not need that. How can I 
>> eliminate it??
>>
>> Thanks.
>>
>> UTF-8 Byte Order Mark – BOM:
>> http://unicode.org/faq/utf_bom.html#BOM
>>
>> Best Regards,
>>
>> Eli  Orr
>> CTO & Founder
>> Mimmage.com
>> My virtual vCard
>> LogoDial Ltd.
>> M:+972-54-7379604
>> O:+972-74-703-2034
>> F: +972-77-3379604
>>
>> Plaut 10, Rehovot, Israel
>> Email:   eli@logodial.com
>> Skype:  eliorr.com
>>
>>
>> -
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
>> http://www.php.net/unsub.php
>>
>>
>
> Can you show us the PHP script that DOES output the BOM?
>
> Normally, PHP doesn't do this automatically (AFAIK). The main reason being is 
> that it is often the case that the BOM appears in the source code file before 
> the 
> If a BOM is being issued by PHP, it is being done programmatically, or is 
> being missed due to the initial source code file having the BOM set.
>
> See http://docs.php.net/manual/en/function.session-start.php#102431,
> http://docs.php.net/manual/en/function.header.php#95864, etc.
>
> Now. Having said all of that, you may find you are using some sort of output 
> buffering and that is setting the BOM after the headers are sent.
>
> But, as it stands, PHP will not be generating the BOM for you.
>
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
> http://www.php.net/unsub.php
>
>
>

No. The parser does not _ADD_ the BOM.

The bom already exists in your source code. Nothing to do with PHP.

The file you included that has the UTF-8 constants has the BOM.

You need to edit that file and remove the BOM. The actions you need to take 
will depend upon your editor.

--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr

Hi Richard, 

Thanks.
Indeed, that is the case - I've included a code that has UTF-8 string contants 
-so I guess the PHP 
parser set the UTF-8 mode to ON so that the returned string to the client has 
the UTF-8 BOM. 

It is not a big issue as the mobile app guys aware of this and make the proper 
3 bytes offset.
Anyhow I was looking for a service to control that behaviour. 

 Thanks

Eli

-Original Message-
From: Richard Quadling [mailto:rquadl...@gmail.com] 
Sent: Tuesday, April 12, 2011 12:45 PM
To: Eli Orr
Cc: php-general@lists.php.net
Subject: Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile 
App

2011/4/12 Eli Orr :
> Dear PHP Gurus,
>
> I would like to Eliminate the 3 UTF-8 BOM enforced on my returned BLOB:
>
> The PHP server adds  utf-8 BOM (UTF-8 Byte Order Mark  - in the 
> beginning of
> UTF-8  files) which
> consists of three bytes: EF BB BF.
>
> The Mobile App served by the server Does not need that. How can I 
> eliminate it??
>
> Thanks.
>
> UTF-8 Byte Order Mark – BOM:
> http://unicode.org/faq/utf_bom.html#BOM
>
> Best Regards,
>
> Eli  Orr
> CTO & Founder
> Mimmage.com
> My virtual vCard
> LogoDial Ltd.
> M:+972-54-7379604
> O:+972-74-703-2034
> F: +972-77-3379604
>
> Plaut 10, Rehovot, Israel
> Email:   eli@logodial.com
> Skype:  eliorr.com
>
>
> -
>
>
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
> http://www.php.net/unsub.php
>
>

Can you show us the PHP script that DOES output the BOM?

Normally, PHP doesn't do this automatically (AFAIK). The main reason being is 
that it is often the case that the BOM appears in the source code file before 
the http://docs.php.net/manual/en/function.session-start.php#102431,
http://docs.php.net/manual/en/function.header.php#95864, etc.

Now. Having said all of that, you may find you are using some sort of output 
buffering and that is setting the BOM after the headers are sent.

But, as it stands, PHP will not be generating the BOM for you.

--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr
Dear PHP Gurus, 

I would like to Eliminate the 3 UTF-8 BOM enforced on my returned BLOB:

The PHP server adds  utf-8 BOM (UTF-8 Byte Order Mark  - in the beginning of
UTF-8  files) which 
consists of three bytes: EF BB BF.   

The Mobile App served by the server Does not need that. How can I eliminate
it??

Thanks.

UTF-8 Byte Order Mark – BOM:
http://unicode.org/faq/utf_bom.html#BOM

Best Regards, 

Eli  Orr
CTO & Founder 
Mimmage.com 
My virtual vCard 
LogoDial Ltd.
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel 
Email:   eli@logodial.com
Skype:  eliorr.com


- 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php