Hi, 2012/8/26 Ángel González <keis...@gmail.com>: > Even worse, HTML5 doesn't seem to have any provision for that, as it works > with characters. A user agent would have to protect himself from this by > making > those kind of utf-8 characters a hard error instead of trying to recover > from it.
Right. I would like to have this behavior. However, who is going to use a browser that raise fatal error for bad encoding? While others just render it as safe as possible? Sending valid encoding is programmer's task. Enforcing and setting default_charset is more secure and best practice since 2000. Why not we set the default? I think UTF-8 is good for most users. BTW, Ruby on Rails depend on Ruby's exception for badly encoded output. We could do the same thing with output buffer and mb_check_encoding(), but programmer should validate inputs and ensure valid encoding in first place. Output time validation should be fail safe. IMHO. If there aren't any better idea, I'm willing to write patch for this. i.e. set default for default_charset=UTF-8, create system wide input/ output/internal encoding setting and use it as default. Any ideas? Regards, -- Yasuo Ohgaki yohg...@ohgaki.net -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php