|
Posted by Taras_96 on 01/25/07 02:18
> oddly put question. 'http output' is not a php function. there are
> individual functions that allow you to format data in a variety of formats
> from utf-8 to base 64, etc.. the answer to your specific question is, no.
That makes it a bit clearer. However, this next code snippet explains
what I was trying to get at (it's from the PHP website):
"Be aware that the *strings in your source files must match the
encoding you specify by mb_internal_encoding*. It appears the Parser
loads raw bytes from the file and refers to its internal encoding to
determine their actual encoding.
To demonstrate, the following outputs as espected when the /source/
file is Latin-1 encoded:
<?php
mb_internal_encoding("iso-8859-1");
mb_http_output( "UTF-8" );
ob_start("mb_output_handler");
echo "üöä<br/>";
?>üöä"
"
So, HTTP output as I understand it, assumes that the output it received
is in a certain encoding (indicated by the internal encoding), and
converts it to whatever output is set by the mb_http_output function,
correct?
I admit that my original message wasn't that clear - 'if your PHP
source is stored' should have read something like 'if the output from
your PHP function is UTF-8'. So, back to my original question, if all
of PHP output was UTF-8, could I use mb_http_output and output
buffering to deliver this to the browser as UCS-2 by the following:
mb_internal_encoding("UTF-8");
mb_http_output("UCS-2");
ob_start("mb_output_handler");
One other thing, the term 'internal encoding' is used quite often:
"If encoding is omitted, internal character encoding is used."
(http://www.php.net/manual/en/function.mb-strlen.php)
Is this simply some variable related to the mb package that indicates,
if no other encoding is specified, the encoding of the strings it
receives?
Thanks
Taras
> as
> for using the other formatting types/functions...they may be required in
> order for you to interact with a database or to format a binary file so a
> browser can receive it and handle it properly - as in, base64 encoding an
> executable where the browser should ask if it should be saved, run, etc.
>
> hth
[Back to original message]
|