Solved

enable php.ini function.mb-decode-mimeheader

Posted on 2013-01-24
11
593 Views
Last Modified: 2013-01-27
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
0
Comment
Question by:rgb192
  • 6
  • 5
11 Comments
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38815413
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
 

Author Comment

by:rgb192
ID: 38816551
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
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38820484
which is already enabled
meaning you took out the ; in front of it? Did you restart Apache after that?
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38820523
Here is some info from phpinfo() about the hosted server my wesite runs on:
server config info
0
 

Author Comment

by:rgb192
ID: 38820805
>>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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38820825
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
 

Author Comment

by:rgb192
ID: 38822922
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
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 38822966
Can you try this?
echo htmlentities(mb_decode_mimeheader('=?iso-8859-1?B?RGlhbmEgQ3Jpc3TzYmFs?='));

Open in new window

0
 

Author Comment

by:rgb192
ID: 38823134
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
 

Author Closing Comment

by:rgb192
ID: 38823581
sorry, I meant to click 'accept solution'

but I clicked 'add comment'
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38823998
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

Featured Post

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now