encode string to utf8 before converting to xml
authorThomasV <thomasv@users.mediawiki.org>
Fri, 19 Jun 2009 09:51:40 +0000 (09:51 +0000)
committerThomasV <thomasv@users.mediawiki.org>
Fri, 19 Jun 2009 09:51:40 +0000 (09:51 +0000)
includes/DjVuImage.php

index 406878d..1b8c4e4 100644 (file)
@@ -250,6 +250,7 @@ class DjVuImage {
                        $txt = wfShellExec( $cmd, $retval );
                        wfProfileOut( 'djvutxt' );
                        if( $retval == 0) {
+                               $txt = utf8_encode($txt);
                                $txt = htmlspecialchars($txt);
                                $txt = preg_replace( "/\((page\s[\d-]*\s[\d-]*\s[\d-]*\s[\d-]*\s*\&quot;([^<]*?)\&quot;\s*|)\)/s", "<PAGE value=\"$2\" />", $txt  );
                                $txt = "<DjVuTxt>\n<HEAD></HEAD>\n<BODY>\n" . $txt . "</BODY>\n</DjVuTxt>\n";