ob_iconv_handler():
<?php
// Output text as-is
echo 'blåbærøl', "<br/>\n";
// Set the internal and output encodings
iconv_set_encoding("internal_encoding", "iso-8859-1");
iconv_set_encoding("output_encoding", "utf-8");
// Start the output buffer handler and echo the string again
ob_start("ob_iconv_handler");
echo 'blåbærøl', "<br/>\n";
// Flush and stop the output buffer handler
ob_end_flush();
?>
Output:
blåbærøl
blåbærøl
blåbærøl