Unicode Support for PHP5

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
When will PHP get Unicode support for PHP5? I realize that English is
what everyone speaks when they want to do business, but I potentially
could be not getting clients for my freelancing work simply because I
program in PHP and PHP doesn't support their character set. This
problem has been known for awhile now, mentioned in lots of forums and
recently gotten major exposure from the popular Joel On Software blog.
Yet I see that the Unicode module isn't ready yet even after two
year's effort on it.

Re: Unicode Support for PHP5


Quoted text here. Click to load it

Native Unicode support will come with PHP 6.

Quoted text here. Click to load it

What exactly is your problem? I already use Unicode (UTF-8) for quite a
while without any trouble. You just have to know the limitations in PHP
5 and how to work around them. Some more details might help.


Re: Unicode Support for PHP5

Quoted text here. Click to load it

Sorry to respond so late, Micha. Been away. I just wanted to say that
every time I brag on social bookmarking sites that I like PHP over
other languages, I get two black eyes by guys who love Python, .NET,
Java, Scheme, and Ruby. And then Joel on Software adds to this as he
became a fan of PHP for many years and then dropped them over the
Unicode thing. So, I wanted to be able to go back with ammo to say
that my language was looking to be competitive with other languages.

Not that I have any Unicode needs at the present moment. However, as I
am a PHP freelancer, I do wish to pick up an occasional foreign client
where this may come into play.

Re: Unicode Support for PHP5

Roberto wrote:

Quoted text here. Click to load it

Full Unicode support is due in PHP 6. Developer previews are already
available, and Unicode support on them is mostly pretty good.

But even in PHP 5 (and 4), Unicode output is mostly usable. You just have
to remember that the built-in string functions are not Unicode-aware, and
treat text as strings of octets instead of multi-byte characters. So for

    PHP 5:  echo strlen('ビ');   // prints "3"
    PHP 6:  echo strlen('ビ');   // prints "1"

PHP 5 is usable for non-ASCII character sets -- it just means you have to
think about string functions a little more carefully. The mbstring module
<http://www.php.net/mbstring is a great help too.

Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux, up 11:20.]

                              The Semantic Web
                http://tobyinkster.co.uk/blog/2008/03/09/sw /

Site Timeline