SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: help on unicode

  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    bahrain
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up help on unicode

    hi
    i m trying to convert one character encoding from other and only got this function. iconv()

    now i m only trying to print this and getting this error

    "Fatal error: Call to undefined function: iconv() in c:\program files\easyphp1-7\www\unicode.php on line 2"

    i m using following method

    PHP Code:
    <?php
    echo iconv("ISO-8859-1""UTF-8""This is a test.");
    ?>
    can anybody plz tell me how to convert Arabic-1256 to unicode (UTF-8).i will be really thankful.
    its urgent plzzz.....
    regards
    phphelp

  2. #2
    SitePoint Enthusiast benk's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I'm trying to work out unicode too

    Hi there,
    I've had the same problem. Looks as though iconv is an extension of PHP that is not installed by default.
    Though I'm running PHP via a downloaded package that installs everything itself, I'm now going to have a go at compiling a fresh download of PHP. Regarding, iconv, apparently:
    "To use functions provided by this module, the PHP binary must be built with the following configure line: --with-iconv[=DIR]."

    Which is from:
    http://us4.php.net/iconv

    I'm new to compiling, so if anyone can help with this, that'd be great!
    Meanwhile I'm going to try it, and post the results of my attempts.

  3. #3
    SitePoint Enthusiast benk's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Progress has been made.. but problems when trying to install the iconv extension, which converts between character sets (eg unicode)
    See: http://www.sitepoint.com/forums/showthread.php?t=250131

  4. #4
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Oxford, UK
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you simply want to convert from ISO-8859-1 to Unicode (UTF-8), use the utf8_encode() function.

    If you can't get iconv() to work, you could also try the Multibyte String functions, and in particular mb_convert_encoding().

  5. #5
    SitePoint Enthusiast benk's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, thanks for the reply. I read that some browsers will submit form data in different formats, like Windows 1252 (or something like that) which I think is a superset of the ISO-8859-1, for which the utf8_encode function won't work properly, true?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •