summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2010-04-02 20:08:15 +0000
committerRob Richards <rrichards@php.net>2010-04-02 20:08:15 +0000
commit01d9389c2c9c12500f1a776283dd3b83fd0d9a1a (patch)
tree3c6e31482347d98deafdec60a750e7f97e1a9b84
parent42bc0de99a7199129f89be5daa9da78a48075419 (diff)
downloadphp-git-01d9389c2c9c12500f1a776283dd3b83fd0d9a1a.tar.gz
fix bug #48983 (DomDocument : saveHTMLFile wrong charset)
-rw-r--r--ext/dom/document.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 5b8e3c6efa..2eda7b72ad 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -2252,6 +2252,7 @@ PHP_FUNCTION(dom_document_save_html_file)
dom_object *intern;
dom_doc_propsptr doc_props;
char *file;
+ const char *encoding;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
return;
@@ -2264,11 +2265,12 @@ PHP_FUNCTION(dom_document_save_html_file)
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
- /* encoding handled by property on doc */
+
+ encoding = (const char *) htmlGetMetaEncoding(docp);
doc_props = dom_get_doc_props(intern->document);
format = doc_props->formatoutput;
- bytes = htmlSaveFileFormat(file, docp, NULL, format);
+ bytes = htmlSaveFileFormat(file, docp, encoding, format);
if (bytes == -1) {
RETURN_FALSE;