Re: Http_output





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

.



Relevant Pages

  • RE: [PHP] Convert UTF-8 to windows-874?
    ... [PHP] Convert UTF-8 to windows-874? ... I think that the iconv function/package may have what you are looking ... same thing as an OSS encoding of another name. ...
    (php.general)
  • Re: utf-8 data
    ... Create the tables in the database to store the TEXT as UTF-8. ... Deliver your HTML documents in UTF-8 encoding by setting the right headers in PHP (Header, not META tag, allthough it is wise to set the META tag too. ...
    (comp.lang.php)
  • Re: utf und latin
    ... Datenbank in ein "rohes" Format zu bringen (die Terminologie spricht ... (welches zufälligerweise UTF-8 ist, aber das muss man nicht wissen). ... Dabei ist das $encoding prinzipiell egal, ...
    (de.comp.lang.perl.misc)
  • Re: Does Base64 encoding before encryption makes it easier to break?
    ... ]>> inherently affect the statistical properties in them. ... ]a secret transformation not a 'public' transformation. ... ]represented as 4 integers in hex format or in decimal ... ]get back the binary form from the base64 encoding, ...
    (sci.crypt)
  • Re: Bin Hex file nightmare
    ... Dayo's probably right and it's an encoding issue. ... attachment was sent in the BinHex format? ... > Macintosh files differ from files created on other computers. ... > an encoding format that preserves all the data. ...
    (microsoft.public.mac.office.word)