goba            Wed Dec 19 11:31:26 2001 EDT

  Modified files:              
    /phpdoc/scripts     revcheck.php 
  Log:
  Using charset from XML files encoding, defaults to iso-8859-1
  
  
Index: phpdoc/scripts/revcheck.php
diff -u phpdoc/scripts/revcheck.php:1.9 phpdoc/scripts/revcheck.php:1.10
--- phpdoc/scripts/revcheck.php:1.9     Wed Dec 19 11:16:04 2001
+++ phpdoc/scripts/revcheck.php Wed Dec 19 11:31:25 2001
@@ -296,6 +296,7 @@
   // Used regexps here for parsing to be compatible with
   // non XML compatible PHP setups
   $translation_xml = $docdir . $lang . "/translation.xml";
+  $output_charset = 'iso-8859-1';
   $translation = array();
   if (@file_exists($translation_xml)) {
     $txml = join("", file($translation_xml));
@@ -305,6 +306,11 @@
     preg_match("!<intro>(.+)</intro>!s", $txml, $match);
     $translation["intro"] = trim($match[1]);
     
+    // Get encoding for the output
+    preg_match("!<\?xml(.+)\?>!U", $txml, $match);
+    $xmlinfo = get_attr_array($match);
+    $output_charset = $xmlinfo[1]["encoding"];
+    
     // Get persons list
     preg_match_all("!<person(.+)/\\s?>!U", $txml, $matches);
     $translation['persons'] = get_attr_array($matches[1]);
@@ -321,7 +327,7 @@
   print("<html>
 <head>
 <title>PHPDOC Revision-check</title>
-<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
+<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$output_charset\">
 <style type=\"text/css\"><!-- 
  h2 {font-family: arial,helvetica,sans-serif; color: #FFFFFF; font-size:28px; }
  td,a,p {font-family:arial,helvetica,sans-serif; color:#000000; font-size:14px; }


Reply via email to