WordPress.org

Ready to get started?Download WordPress

Forums

Postie and undefined iconv (2 posts)

  1. drkestrel
    Member
    Posted 7 years ago #

    My environment variable on a shared server with my hosting company is as follows:
    PATH = /usr/local/bin:/usr/bin:/bin
    DOCUMENT_ROOT = /home/myhostname/public_html
    HTTP_ACCEPT = */*
    HTTP_ACCEPT_ENCODING = gzip, deflate
    HTTP_ACCEPT_LANGUAGE = en-gb
    HTTP_CONNECTION = Keep-Alive
    HTTP_COOKIE = PHPSESSID=4106c9a9c637449bfb9261707e234ef8
    HTTP_HOST = http://www.myhostname.org.uk
    HTTP_USER_AGENT = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; image_azv; InfoPath.1)
    SCRIPT_FILENAME = /home/myhostname/public_html/test.php
    SERVER_ADMIN = webmaster@myhostname.org.uk
    SERVER_NAME = http://www.myhostname.org.uk
    SERVER_PORT = 80
    SERVER_SOFTWARE = Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b
    GATEWAY_INTERFACE = CGI/1.1
    SERVER_PROTOCOL = HTTP/1.1
    REQUEST_METHOD = GET
    QUERY_STRING =

    Using latest WP 2.0.5 and postie version.

    The following error is resultant when an email containing Chinese Text (encoded in "iso-2022-jp" by Outlook 2003 is received).

    How can this be fixed, in light of limited permission to change PHP.ini on a shared server.

    Fatal error: Call to undefined function: iconv() in /home/myhostname/public_html/newWeb/wp-content/plugins/postie/postie-functions.php on line

    I think the following is the culprit function:
    function ConvertToUTF_8($encoding,$charset,&$body) {
    $charset = strtolower($charset);
    $encoding = strtolower($encoding);
    switch($charset) {
    case "iso-8859-1":
    $body = utf8_encode($body);
    break;
    case "iso-2022-jp":
    $body = iconv("ISO-2022-JP//TRANSLIT","UTF-8",$body);
    break;
    }
    }

  2. drkestrel
    Member
    Posted 7 years ago #

    My ISP, http://www.diyhosts.co.uk has sadly informed me that they are not going to upgrade to PHP5.2.0, as http://bugs.php.net/bug.php?id=32244&edit=1 suggests the latest version will solve the problem

    Building on the penultimate post dated 22-Jun-2004 at http://ch2.php.net/manual/en/function.iconv.php, has any one got any idea how I can use pattern matching to convert iso-2022-jp to UTF-8?

Topic Closed

This topic has been closed to new replies.

About this Topic