Web lists-archives.com

[PHP] mb_output_handler/default_mimetype and mbstring.http_output_conv_mimetypes

Greetings, All.

I'm trying (yet again) to get some automatic behavior, that is supposedly
possible with certain options combination, but I can't seems to get the
desired results.

The core idea is to get automatic conversion from internal script encoding to
he output encoding, which is quite easily achievable with mb_output_handler,
but to also have a quick and clean way to escape transcoding without changing
of such options.

Now, looking over the available options (and their descriptions in the
manual), I've cooked a config that looks as follows:

Zend Multibyte Support => provided by mbstring
default_charset => CP866 => CP866
default_mimetype => text/plain => text/plain
input_encoding => CP866 => CP866
internal_encoding => UTF-8 => UTF-8
output_buffering => 0 => 0
output_encoding => CP866 => CP866
output_handler => mb_output_handler => mb_output_handler
zend.script_encoding => no value => no value
iconv.input_encoding => no value => no value
iconv.internal_encoding => no value => no value
iconv.output_encoding => no value => no value

HTTP input encoding translation => disabled
mbstring.detect_order => no value => no value
mbstring.encoding_translation => Off => Off
mbstring.func_overload => 0 => 0
mbstring.http_input => no value => no value
mbstring.http_output => no value => no value
mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text/|application/xhtml\+xml)
mbstring.internal_encoding => no value => no value
mbstring.language => neutral => neutral
mbstring.strict_detection => Off => Off
mbstring.substitute_character => no value => no value

Now, if I don't touch anything, PHP correctly convert srings printed by the
script from UTF-8 (script encoding) into CP866 (terminal encoding).

But no matter what I do to default_mimetype, no matter where I set it (INI,
command line, script itself), the result doesn't change. The handler will
ALWAYS translate the output. I'm beginning to doubt my understanding of
mbstring.http_output_conv_mimetypes meaning and intention.

This is using both CLI and CGI executables.

Anyone can explain this to me?

Sincerely Yours, Andrey Repin <anrdaemon@xxxxxxxxxxx>

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