enable php.ini function.mb-decode-mimeheader

what has to be enabled in php 5.2 and php 5.3 to allow

manual: http://php.net/manual/en/function.mb-decode-mimeheader.php

echo mb_decode_mimeheader('=?iso-8859-1?B?RGlhbmEgQ3Jpc3TzYmFs?=');

output
Diana Cristóbal
LVL 1
rgb192Asked:
Who is Participating?
 
Robert SchuttConnect With a Mentor Software EngineerCommented:
Can you try this?
echo htmlentities(mb_decode_mimeheader('=?iso-8859-1?B?RGlhbmEgQ3Jpc3TzYmFs?='));

Open in new window

0
 
Robert SchuttSoftware EngineerCommented:
I'm guessing that means the code I posted earlier doesn't work for you.

I looked around and used phpinfo() to look at the settings of my hosting provider. Apparently they have activated this module with:
configure '--enable-mbstring'

Open in new window

More info here: http://uk.php.net/manual/en/mbstring.installation.php (that is, assuming you are doing this on your own server, on a hosted environment it may not be possible).
0
 
rgb192Author Commented:
your code worked for me on hostgator.com lamp


but not on wamp

php.ini

extension=php_mbstring.dll (which is already enabled
but how to edit this:
[mbstring]
; language for internal character representation.
; http://php.net/mbstring.language
;mbstring.language = Japanese

; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
; http://php.net/mbstring.internal-encoding
;mbstring.internal_encoding = EUC-JP

; http input encoding.
; http://php.net/mbstring.http-input
;mbstring.http_input = auto

; http output encoding. mb_output_handler must be
; registered as output buffer to function
; http://php.net/mbstring.http-output
;mbstring.http_output = SJIS

; enable automatic encoding translation according to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
;       portable libs/applications.
; http://php.net/mbstring.encoding-translation
;mbstring.encoding_translation = Off

; automatic encoding detection order.
; auto means
; http://php.net/mbstring.detect-order
;mbstring.detect_order = auto

; substitute_character used when character cannot be converted
; one from another
; http://php.net/mbstring.substitute-character
;mbstring.substitute_character = none;

; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
; http://php.net/mbstring.func-overload
;mbstring.func_overload = 0

; enable strict encoding detection.
;mbstring.strict_detection = Off

; This directive specifies the regex pattern of content types for which mb_output_handler()
; is activated.
; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)
;mbstring.http_output_conv_mimetype=

; Allows to set script encoding. Only affects if PHP is compiled with --enable-zend-multibyte
; Default: ""
;mbstring.script_encoding=

Open in new window

0
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
Robert SchuttSoftware EngineerCommented:
which is already enabled
meaning you took out the ; in front of it? Did you restart Apache after that?
0
 
Robert SchuttSoftware EngineerCommented:
Here is some info from phpinfo() about the hosted server my wesite runs on:
server config info
0
 
rgb192Author Commented:
>>meaning you took out the ; in front of it? Did you restart Apache after that?

I think wamp comes default no
: in front of it
0
 
Robert SchuttSoftware EngineerCommented:
oh, ok.

and looking at the other settings' documentation quickly, they all seem to be default settings...?

Then back to square 1, have you looked into the other suggestions to your earlier question regarding the use of UTF-8 encoding for example? Or is it not outputting anything, if so any error message?
0
 
rgb192Author Commented:
there is the same output
with and without
mb_decode_mimeheader(
around the text

no errors or warnings for this line
error_reporting(E_ALL);
0
 
rgb192Author Commented:
thanks,
echo htmlentities(mb_decode_mimeheader('=?iso-8859-1?B?RGlhbmEgQ3Jpc3TzYmFs?='));
worked

A related question
I want
¿¿¿¿¿ ¿¿¿¿¿¿¿
from
=?KOI8-R?B?6dLJzsEg78zaz8XXwQ==?=


http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28010124.html
0
 
rgb192Author Commented:
sorry, I meant to click 'accept solution'

but I clicked 'add comment'
0
 
Robert SchuttSoftware EngineerCommented:
No problem.

I had a look at the cyrillic text. It seems to be a real problem. It could easily be something that needs to be enabled on the server, in fact as you already noted, EE doesn't show it. You may need to have some other Topic Areas added like Apache/IIS? If I look at a site like koi8.pp.ru then it should be solvable but I haven't been able to yet. In VB.NET your string decodes without problem. Not really relevant but at least an 'outside' confirmation that the input string is correct.
show text
0
All Courses

From novice to tech pro — start learning today.