test500: raise AssertionError to correctly end up in handle_error().
Refactor UTF-8 handling of error pages.