On Mon, March 12, 2012 2:44 pm, Rasmus Lerdorf wrote: > But you can't necessarily hardcode the encoding if you are writing > portable code. That's a bit like hardcoding a timezone. In order to > write portable code you need to give people the ability to localize > it.
If you wanted it portable, wouldn't you need to have a variable there, so it can survive the ISO-8859-1 to UTF-8 change, and to allow people to change it despite whatever non-standard setting might happen to be in somebody else's php.ini? I mean, sure, it's nice if it "just works" for the folks who want to install and have it localized for their own charset hard-coded in php.ini, but if it's being multi-national website, you have to pass in a variable there, which seems the more portable option to this naive reader. Having it default to whatever happens to be in php.ini only solves the use case of people who only want to serve up their content in their own charset. I'd have to agree with Stas that everybody should start passing in a variable there, that can be set somewhere in a config, or, perhaps, would DEFAULT to, errrr... You can't default to a function call. ANOTHER magic constant like __INI_CHARSET__ ??? That's probably a bad idea... -- brain cancer update: http://richardlynch.blogspot.com/search/label/brain%20tumor Donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php