Include meta charset header in saved HTML file for long OStatus messages; without, DOMDocument::loadHTML assumed Latin-1 instead of UTF-8.

This commit is contained in:
Brion Vibber 2010-03-29 16:27:50 -07:00
parent bf468e2a8d
commit 6046a6cc6a
1 changed files with 5 additions and 1 deletions

View File

@ -1685,7 +1685,11 @@ class Ostatus_profile extends Memcached_DataObject
*/
function saveHTMLFile($title, $rendered)
{
$final = sprintf("<!DOCTYPE html>\n<html><head><title>%s</title></head>".
$final = sprintf("<!DOCTYPE html>\n" .
'<html><head>' .
'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' .
'<title>%s</title>' .
'</head>' .
'<body>%s</body></html>',
htmlspecialchars($title),
$rendered);