From 6dd4ee072f39cb5508695190ee7da779bf8825ff Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Thu, 3 Jan 2019 16:46:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E7=A0=81=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=8D=A2word=E8=BD=AC=E5=8C=96=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/info_amp.php | 1 + application/libraries/wordphp.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/controllers/info_amp.php b/application/controllers/info_amp.php index 3f2fca4e..f5eb514d 100644 --- a/application/controllers/info_amp.php +++ b/application/controllers/info_amp.php @@ -389,6 +389,7 @@ class Info_amp extends CI_Controller $rt->img_prex = $md5_file; $html = $rt->readDocument($path); $html = str_ireplace($rt->img_dir, '//202.103.68.62:9096/information-view/information/word_img', $html); + //file_put_contents($path.'.txt', $html); echo(json_encode(array( 'status' => 'success', 'path' => $path, diff --git a/application/libraries/wordphp.php b/application/libraries/wordphp.php index ac3778cc..e07e0f0b 100644 --- a/application/libraries/wordphp.php +++ b/application/libraries/wordphp.php @@ -39,7 +39,7 @@ class WordPHP private $doc_xml; private $doc_media = array(); private $last = 'none'; - private $encoding = 'ISO-8859-1'; + private $encoding = 'UTF-8'; private $tmpDir = 'tmp'; //图片目录和前缀 public $img_dir = ''; @@ -485,6 +485,7 @@ class WordPHP // look for new paragraphs $paragraph = new XMLReader; $p = $reader->readOuterXML(); + //return $p; if ($reader->nodeType == XMLREADER::ELEMENT && $reader->name === 'w:p') { // set up new instance of XMLReader for parsing paragraph independantly