Fog Creek Software
Discussion Board




PHP and unicode: iconv

It seems to me that iconv is able to handle UNICODE, so as long as the library is well interfaced with PHP, PHP can handle unicode through the iconv librabry.

Patrick Roumanoff
Tuesday, October 14, 2003

Couple iconv or mb_output_handler with output buffering's output handler (pass a parameter to ob_start), and you should be able to generate valid output in any encoding.

Sérgio Carvalho (http://sergiocarvalho.com/)
Tuesday, October 14, 2003

Well, yeah, you could do that. But how readable will your code be? The main benefit of PHP is how quick and easy it is to put code together. Sprinkling iconv calls around just about every string you work with is an exercise in self-torture.

Before I went to bed I was going to post a facetious comment to that effect, something like "well, you *could* use arrays of integers to represent Unicode strings and write your own library of functions to manipulate them..." but now I see Joel has posted a link where it is a (semi?) serious suggestion!

Daryl Oidy
Wednesday, October 15, 2003

*  Recent Topics

*  Fog Creek Home