php vs python

Michael Fesser netizen at gmx.de
Fri May 23 10:59:17 EDT 2008


.oO(Duncan Booth)

>Michael Fesser <netizen at gmx.de> wrote:
>
>> The only little problem is that PHP doesn't have native Unicode
>> support yet, which will change with PHP 6. But of course you can still
>> use UTF-8 without any trouble, I do it all the time. You just have to
>> keep in mind that many string functions still work on bytes, not on
>> characters, but this can almost always be solved with the Multibyte
>> extension. Apart from that there's no problem with PHP and UTF-8. It's
>> also easily possible to convert between various encodings using the
>> iconv extension. 
>> 
>As I remember it the problem was that the data was stored in a database 
>in latin-1 but the HTML page had to be in utf-8 (because the rest of the 
>server and therefore all the page skins were already in utf-8). In 
>python that would be a trivial conversion but I was told that in PHP it 
>wasn't.

It would have been trivial in PHP as well, assuming the DB was MySQL,
which could have done this conversion automatically when sending the
data to the script.
 
>But one small example isn't really the point. It's that the whole way 
>Python works seems *to me* to make sense and (mostly) fits together 
>cleanly and consistently. YMMV

Fair enough. The nature of PHP as being a grown language has its
advantages, but also a lot of drawbacks, which are hard to solve.

Micha



More information about the Python-list mailing list