gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r583 - in i18nHTML: . src


From: grothoff
Subject: [GNUnet-SVN] r583 - in i18nHTML: . src
Date: Sun, 3 Apr 2005 19:02:38 -0700 (PDT)

Author: grothoff
Date: 2005-04-03 19:02:32 -0700 (Sun, 03 Apr 2005)
New Revision: 583

Modified:
   i18nHTML/AUTHORS
   i18nHTML/ChangeLog
   i18nHTML/README
   i18nHTML/src/commitMassTranslation.php
   i18nHTML/src/commitTranslation.php
   i18nHTML/src/editor.php
   i18nHTML/src/i18nhtml.inc
   i18nHTML/src/i18nhtml_config.inc
   i18nHTML/src/index.php
   i18nHTML/src/start.php
   i18nHTML/src/status.php
   i18nHTML/src/translate.php
   i18nHTML/src/vote.php
Log:
trying to solve character set problems -- untested

Modified: i18nHTML/AUTHORS
===================================================================
--- i18nHTML/AUTHORS    2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/AUTHORS    2005-04-04 02:02:32 UTC (rev 583)
@@ -1,2 +1,3 @@
 Christian Grothoff <address@hidden>
 Kenneth J. Davis <address@hidden>
+Bernard Paques <address@hidden>

Modified: i18nHTML/ChangeLog
===================================================================
--- i18nHTML/ChangeLog  2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/ChangeLog  2005-04-04 02:02:32 UTC (rev 583)
@@ -1,3 +1,11 @@
+Sun Apr  3 20:54:14 EST 2005   CG
+        Trying to fix I18N character set issues with
+       code from yacs.  Still testing, likely to break
+       the database encoding (will require re-coding of
+       existing translations, script to do so will be 
+       done after I'm sure that this approach actually
+       works).
+       
 Tue Jan  4 13:30:20 EST 2005   CG
        Added code to create an initial database to bootstrap 
        i18nHTML (see end of README and contrib/populate.sql).

Modified: i18nHTML/README
===================================================================
--- i18nHTML/README     2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/README     2005-04-04 02:02:32 UTC (rev 583)
@@ -24,7 +24,7 @@
 CREATE DATABASE translation;
 GRANT select,insert,update,delete,create,alter,drop
      ON translation.* TO address@hidden;
-SET PASSWORD FOR address@hidden('pass');
+SET PASSWORD FOR address@hidden('pass');
 FLUSH PRIVILEGES;
 
 

Modified: i18nHTML/src/commitMassTranslation.php
===================================================================
--- i18nHTML/src/commitMassTranslation.php      2005-04-03 19:58:30 UTC (rev 
582)
+++ i18nHTML/src/commitMassTranslation.php      2005-04-04 02:02:32 UTC (rev 
583)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff
+     (C) 2003, 2004, 2005 Christian Grothoff
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -26,7 +26,9 @@
   W("Translating to English currently not allowed.\n");
   die();
 }
-echo "<html><head><title>WWW translation: commit</title></head><body>";
+echo "<html><head>";
+TITLE("WWW translation: commit");
+echo "</head><body>";
 W("Processing translations...");
 P();
 $done = 0;
@@ -44,7 +46,7 @@
     $num--;
     $row = mysql_fetch_array($result);
     if ($dec == bin2hex(md5(urldecode($row["c"])))) {
-      $enc = $row["c"];
+      $enc = mysql_real_escape_string($row["c"]);
       break;
     }
   }
@@ -56,21 +58,28 @@
   }  
   $query = "DELETE FROM pending WHERE lang=\"$lang\" AND c=\"$enc\"";
   mysql_query($query, $connection); 
-  $t = urlencode($val);
-  // $t = urlencode(htmlentities($val, ENT_QUOTES, $charset));
+  $t = mysql_real_escape_string(to_unicode($val));
   $query = "SELECT ranking FROM map WHERE name=\"$enc\" AND lang=\"$lang\" AND 
translation=\"$t\"";
   $result = mysql_query($query, $connection);
   $num = 0;
   if ($result) 
     $num = mysql_numrows($result);
   if ($num == 0) {
-    $query = "INSERT INTO map VALUES(\"$enc\", \"$lang\", \"$t\", 1, \"" . 
$_SERVER['REMOTE_ADDR'] . "\");";
-    mysql_query($query, $connection);
-    $done++;
-    W("Storing translation for &quot;%s&quot = &quot;%s&quot;.",
-      ARRAY(urldecode($enc),
-           urldecode($t)));
-    BR();  
+    if (array_count_values($enc)['%'] != array_count_values($t)['%']) {
+      W("Commit '%s->%s' failed.", $enc, $t);
+      W("The number of percent signs in source text and translation do not 
match.");     
+      W("Note that you must preserve all %%s expressions unchanged.");
+      W("Also, a single displayed %% sign must be translated into two (%%%%) 
such signs.");
+      P();
+    } else {
+      $query = "INSERT INTO map VALUES(\"$enc\", \"$lang\", \"$t\", 1, \"" . 
$_SERVER['REMOTE_ADDR'] . "\");";
+      mysql_query($query, $connection);
+      $done++;
+      W("Storing translation for &quot;%s&quot = &quot;%s&quot;.",
+        ARRAY(urldecode($enc),
+             urldecode($t)));
+      BR();  
+    }
   }  
 }
 P();

Modified: i18nHTML/src/commitTranslation.php
===================================================================
--- i18nHTML/src/commitTranslation.php  2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/src/commitTranslation.php  2005-04-04 02:02:32 UTC (rev 583)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff
+     (C) 2003, 2004, 2005 Christian Grothoff
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -30,12 +30,7 @@
   die();
 }
 
-// note: $text is already urlencoded (by submitting via form) and html 
compatible
-// ensure translation is stored in encoded form and html compatible
-// if (get_magic_quotes_gpc()) $translation = stripslashes($translation);
-
-// $t = urlencode(htmlentities($translation, ENT_QUOTES, $charset));
-$t = urlencode($translation);
+$t = mysql_real_escape_string(to_unicode($translation));
 // check for identical translation
 $query = "SELECT ranking FROM map WHERE name=\"$text\" AND lang=\"$lang\" AND 
translation=\"$t\"";
 $result = mysql_query($query, $connection);
@@ -44,22 +39,36 @@
   $num = mysql_numrows($result);
 }
 if ($num > 0) {
-  echo "<html><body>";
+  echo "<html><head>";
+  TITLE("Translation exists.");
+  echo "</head><body>";
   W("Translation exists.");   
   extlink($back, "Back...");
   generateFooter();
   echo "</body></html>";
 } else {
-  //  if (!get_magic_quotes_gpc()) $t = addslashes($t); // ensure escaped 
before adding to DB
-  $query = "INSERT INTO map VALUES(\"$text\", \"$lang\", \"$t\", 1, \"" . 
$_SERVER['REMOTE_ADDR'] . "\");";
-  $result = mysql_query($query, $connection);
-  if ($result) {
-    header("Location: " . $back); /* Redirect browser */
+  if (array_count_values($text)['%'] != array_count_values($t)['%']) {
+      echo "<html><head>";
+      TITLE("Commit failed.");
+      echo "</head><body>";
+      W("Commit failed.");
+      W("The number of percent signs in source text and translation do not 
match.");     
+      W("Note that you must preserve all %%s expressions unchanged.");
+      W("Also, a single displayed %% sign must be translated into two (%%%%) 
such signs.");
+      echo "</body></html>"
   } else {
-    echo "<html><body>";
-    W("Commit ('%s') failed: ", $query);
-    echo mysql_error();
-    echo "</body></html>";
+    $query = "INSERT INTO map VALUES(\"$text\", \"$lang\", \"$t\", 1, \"" . 
$_SERVER['REMOTE_ADDR'] . "\");";
+    $result = mysql_query($query, $connection);
+    if ($result) {
+      header("Location: " . $back); /* Redirect browser */
+    } else {
+      echo "<html><head>";
+      TITLE("Commit failed.");
+      echo "</head><body>";
+      W("Commit ('%s') failed: ", $query);
+      echo mysql_error();
+      echo "</body></html>";
+    }
   } 
 }
 ?>
\ No newline at end of file

Modified: i18nHTML/src/editor.php
===================================================================
--- i18nHTML/src/editor.php     2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/src/editor.php     2005-04-04 02:02:32 UTC (rev 583)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff
+     (C) 2003, 2004, 2005 Christian Grothoff
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -65,7 +65,7 @@
     ARRAY($start, $end));
   P();
 
-  echo "<form action=\"" . $i18nHTMLbase . "commitMassTranslation.php\">";
+  echo "<form method="POST" action=\"" . $i18nHTMLbase . 
"commitMassTranslation.php\">";
   echo "<input type=hidden name=\"xlang\" value=\"$xlang\">";
   $endp = $end + 1;
   echo "<input type=hidden name=\"start\" value=\"$endp\">";

Modified: i18nHTML/src/i18nhtml.inc
===================================================================
--- i18nHTML/src/i18nhtml.inc   2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/src/i18nhtml.inc   2005-04-04 02:02:32 UTC (rev 583)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff and other contributing authors.
+     (C) 2003, 2004, 2005 Christian Grothoff and other contributing authors.
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -27,6 +27,7 @@
   // $editor can be set to create a translation
   // tag even if a translation is already available.
   // there is currently no security.
+  //
   // An "_" is used for functions that return the
   // translated string instead of printing it directly.
   // These functions are used for "%s" printing with W().
@@ -39,6 +40,8 @@
 // obtain user db specific configuration parameters
 include("i18nhtml_config.inc");
 
+header("Content-type: text/html; charset=utf-8");
+
 // establish default connection to database server
 $connection = @mysql_connect($i18nHTMLsqlServer,
                             $i18nHTMLsqlUser,
@@ -119,6 +122,7 @@
 if ($xlang)
   $lang = $xlang;
 $lang = ucfirst(strtolower($lang));
+$lang = mysql_real_escape_string($lang);
 $editor = $_REQUEST['editor'];
 
 
@@ -241,6 +245,172 @@
   }
 }
 
+
+/**
+ * restore UTF-8 from HTML Unicode entities
+ *
+ * This function is triggered by the YACS handler during page
+ * rendering.  It is aiming to transcode HTML Unicode entities
+ * (eg, &amp;#8364;) back to actual UTF-8 encoding (eg, �).
+ *
+ * @param string a string with a mix of UTF-8 and of HTML Unicode entities
+ * @return an UTF-8 string
+ */
+function from_unicode($text) {
+  // translate extended ISO8859-1 chars, if any
+  $text = utf8_encode($text);
+  
+  // translate Unicode entities
+  $areas = preg_split('/&#(\d+?);/', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
+  $text = '';
+  $index = 0;
+  foreach($areas as $area) {
+    switch($index%2) {
+    case 0: // before entity
+      $text .= $area;
+      break;
+    case 1: // the entity itself
+      
+      // get the integer value
+      $unicode = intval($area);
+      
+      // one byte
+      if($unicode < 0x80) {
+       
+       $text .= chr($unicode);
+       
+       // two bytes
+      } elseif($unicode < 0x800) {
+       
+       $text .= chr( 0xC0 +  ( ( $unicode - ( $unicode % 0x40 ) ) / 0x40 ) );
+       $text .= chr( 0x80 + ( $unicode % 0x40 ) );
+       
+       // three bytes
+      } elseif($unicode < 0x10000) {
+       
+       $text .= chr( 0xE0 + ( ( $unicode - ( $unicode % 0x1000 ) ) / 0x1000 ) 
);
+       $text .= chr( 0x80 + ( ( ( $unicode % 0x1000 ) - ( $unicode % 0x40 ) ) 
/ 0x40 ) );
+       $text .= chr( 0x80 + ( $unicode % 0x40 ) );
+       
+       // more bytes, keep it as it is...
+      } else
+         $text .= '&#'.$unicode.';';
+      
+      break;
+    }
+    $index++;
+  }
+  
+  // the updated string
+  return $text;
+}
+
+/**
+ * transcode multi-byte characters to HTML representations for Unicode
+ *
+ * This function is aiming to preserve Unicode characters through storage in a 
ISO-8859-1 compliant system.
+ *
+ * Every multi-byte UTF-8 character is transformed to its equivalent HTML 
numerical entity (eg, &amp;#4568;)
+ * that may be handled safely by PHP and by MySQL.
+ *
+ * Of course, this solution does not allow for full-text search in the 
database and therefore, is not a
+ * definitive solution to internationalization issues.
+ * It does enable, however, practical use of Unicode to build pages in foreign 
languages.
+ *
+ * Also, this function transforms HTML entities into their equivalent Unicode 
entities.
+ * For example, w.bloggar posts pages using HTML entities.
+ * If you have to modify these pages using web forms, you would like to get 
UTF-8 instead.
+ *
+ * @link 
http://www.evolt.org/article/A_Simple_Character_Entity_Chart/17/21234/ A Simple 
Character Entity Chart
+ *
+ * @param string the original UTF-8 string
+ * @return a string acceptable in an ISO-8859-1 storage system (ie., PHP4 + 
MySQl 3)
+ */
+function to_unicode($input) {
+  
+  // transcode HTML entities to Unicode entities
+  $input = utf8::transcode($input);
+  
+  // scan the whole string
+  $output = '';
+  $index = 0;
+  while($index < strlen($input)) {
+    
+    // look at one char
+    $char = ord($input[$index]);
+    
+    // one byte (0xxxxxxx)
+    if($char < 0x80) {
+      
+      // some chars may be undefined
+      $output .= chr($char);
+      $index += 1;
+      
+      // two bytes (110xxxxx 10xxxxxx)
+    } elseif($char < 0xE0) {
+      
+      // strip weird sequences (eg, C0 80 -> NUL)
+      if($value = (($char % 0x20) * 0x40) + (ord($input[$index + 1]) % 0x40))
+       $output .= '&#' . $value . ';';
+      $index += 2;
+      
+      // three bytes (1110xxxx 10xxxxxx 10xxxxxx) example: euro sign = 
\xE2\x82\xAC -> &#8364;
+    } elseif($char < 0xF0) {
+      
+      // strip weird sequences
+      if($value = (($char % 0x10) * 0x1000) + ((ord($input[$index + 1]) % 
0x40) * 0x40) + (ord($input[$index + 2]) % 0x40))
+       $output .= '&#' . $value . ';';
+      $index += 3;
+      
+      // four bytes (11110xxx 10xxxxxx 10xxxxxx 10xxxxxx)
+    } elseif($char < 0xF8) {
+      
+      // strip weird sequences
+      if($value = (($char % 0x08) * 0x40000) + ((ord($input[$index + 1]) % 
0x40) * 0x1000) + ((ord($input[$index + 2]) % 0x40) * 0x40)
+        + (ord($input[$index + 3]) % 0x40))
+       $output .= '&#' . $value . ';';
+      $index += 4;
+      
+      // five bytes (111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx)
+    } elseif($char < 0xFC) {
+      
+      // strip weird sequences
+      if($value = (($char % 0x04) * 0x1000000) + ((ord($input[$index + 1]) % 
0x40) * 0x40000) + ((ord($input[$index + 2]) % 0x40) * 0x1000)
+        + ((ord($input[$index + 3]) % 0x40) * 0x40) + (ord($input[$index + 4]) 
% 0x40))
+       $output .= '&#' . $value . ';';
+      $index += 5;
+      
+      // six bytes (1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx)
+    } else {
+      
+      // strip weird sequences
+      if($value = (($char % 0x02) * 0x40000000) + ((ord($input[$index + 1]) % 
0x40) * 0x1000000) + ((ord($input[$index + 2]) % 0x40) * 0x40000)
+        + ((ord($input[$index + 3]) % 0x40) * 0x1000) + ((ord($input[$index + 
4]) % 0x40) * 0x40) + (ord($input[$index + 4]) % 0x40))
+       $output .= '&#' . $value . ';';
+      $index += 6;
+    }
+    
+  }
+ 
+  // return the translated string
+  return $output;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 // returns either the translated string
 // or the original string.  Assumes we
 // are passed the original string as occurs
@@ -264,8 +434,7 @@
   if ($a == "")
     return $a;
 
-  // $a = htmlentities($a, ENT_QUOTES, $charset);
-  $u = urlencode($a);
+  $u = mysql_real_escape_string(urlencode($a));
   
   if (!$connection) {
     // database not available, just print English
@@ -319,7 +488,7 @@
     return fix($a);              // just return English string
   } else { // translation available
     $row = mysql_fetch_array($result);
-    return fix(urldecode($row["translation"]));
+    return fix(from_unicode($row["translation"]));
   }
 }
 
@@ -361,7 +530,16 @@
 }
 
 function TITLE($a,$b="") {
+  global $lang;
+  global $languagecodes;
+  echo "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" 
>";
   echo "<title>" . W_($a,$b) . "</title>\n";
+  if (isset($languagecodes[$lang])) {
+    echo "<meta name=\"content-language\" content=\"" . 
+         $languagecodes[$lang] . "\">";
+    echo "<meta name=\"language\" content=\"" . 
+         $languagecodes[$lang] . "\">";
+  }
 }
 
 

Modified: i18nHTML/src/i18nhtml_config.inc
===================================================================
--- i18nHTML/src/i18nhtml_config.inc    2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/src/i18nhtml_config.inc    2005-04-04 02:02:32 UTC (rev 583)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff
+     (C) 2003, 2004, 2005 Christian Grothoff
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published

Modified: i18nHTML/src/index.php
===================================================================
--- i18nHTML/src/index.php      2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/src/index.php      2005-04-04 02:02:32 UTC (rev 583)
@@ -2,17 +2,10 @@
 include("i18nhtml.inc");
 DOCTYPE("HTML", "Transitional");
 echo "<html><head>\n";
-echo "<title>";
-TRANSLATE("i18nHTML - enabling collaborative webpage translation");
-echo "</title>";
+TITLE("i18nHTML - enabling collaborative webpage translation");
 echo "<meta name=\"description\" content=\"";
 TRANSLATE("i18nHTML is a collection of PHP scripts that allow visitors of a 
webpage to help translating it.");
 echo "\">";
-
-echo "<meta name=\"content-language\" content=\"" . 
-     $languagecodes[$lang] . "\">";
-echo "<meta name=\"language\" content=\"" . 
-     $languagecodes[$lang] . "\">";
 ?>
 <meta name="author" content="Christian Grothoff">
 <meta name="keywords" 
content="i18n,HTML,PHP,translation,languages,mysql,database,internationalization,www,free,GNU,GPL">
@@ -34,10 +27,11 @@
 W("i18nHTML defines a set of PHP functions that generate either the translated 
HTML sentences or the original (typically English) text with decorations that 
allow users to provide translations.");
 W("i18nHTML requires the internationalized webpages to be written using the 
provided PHP functions but does not constrain the page design in any way.");
 W("Webpages internationalized with i18nHTML can be updated without loosing 
existing translations for sentences that were not changed.");
+W("Note that it is important that you use the i18nHTML <tt>TITLE</tt> command 
in your documents in order to ensure that the character set and other meta-data 
is set properly.");
 P();
 H2("Download");
 W("You can find the latest version %s.",
-  extlink_("download/i18nHTML-0.0.1.tar.gz", "here"));
+  extlink_("https://gnunet.org/i18nHTML/download/";, "here"));
 W("The latest CVS version can be obtained using");
 PRE("$ svn checkout https://gnunet.org/svn/i18nHTML/";);
 P();    
@@ -54,18 +48,18 @@
     intlink_("editor.php", "here"));
   W("Note that the sentence database is shared with the %s, %s and %s 
projects.",
     ARRAY(extlink_("http://gnunet.org/";, "GNUnet"),
-         extlink_("/doodle/", "doodle"),
-         extlink_("/libextractor/", "libExtractor")));  
+         extlink_("http://gnunet.org/doodle/";, "doodle"),
+         extlink_("http://gnunet.org/libextractor/";, "libExtractor")));  
  }
 
 H2("Bugtrack");
-W("I18nHTML uses Mantis for bugtracking.");
+W("i18nHTML uses Mantis for bugtracking.");
 W("Visit %s to report bugs.",
   extlink_("https://gnunet.org/mantis/","https://gnunet.org/mantis/";));
 W("You need to sign up for a reporter account.");
 W("Please make sure you report bugs under <strong>I18nHTML</strong> and not 
under any of the other projects.");
 P();
-W("If you dislike Mantis and need to report a bug contact %s via e-mail.",
+W("If you dislike Mantis and need to report a bug contact %s via e-mail (good 
luck getting by the spam-filter).",
   extlink_("mailto:address@hidden","address@hidden";));
 
 HR();

Modified: i18nHTML/src/start.php
===================================================================
--- i18nHTML/src/start.php      2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/src/start.php      2005-04-04 02:02:32 UTC (rev 583)
@@ -2,9 +2,7 @@
 include("i18nhtml.inc");
 DOCTYPE("HTML", "Transitional");
 echo "<html><head>\n";
-echo "<title>";
-TRANSLATE("Documentation");
-echo "</title>";
+TITLE("Documentation");
 echo "</head><body>";
 generateLanguageBar();
 H2("Documentation");

Modified: i18nHTML/src/status.php
===================================================================
--- i18nHTML/src/status.php     2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/src/status.php     2005-04-04 02:02:32 UTC (rev 583)
@@ -30,9 +30,7 @@
 
 DOCTYPE("HTML", "Transitional");
 echo "<html><head>\n";
-echo "<title>";
-TRANSLATE("Translation: status");
-echo "</title>";
+TITLE("Translation: status");
 echo "</head><body>";
 W("Language setting is %s.",
   $lang);

Modified: i18nHTML/src/translate.php
===================================================================
--- i18nHTML/src/translate.php  2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/src/translate.php  2005-04-04 02:02:32 UTC (rev 583)
@@ -27,9 +27,7 @@
 
 DOCTYPE("HTML", "Transitional");
 echo "<html><head>\n";
-echo "<title>";
-TRANSLATE("WWW translation");
-echo "</title>";
+TITLE("WWW translation");
 echo "<meta name=\"description\" content=\"";
 TRANSLATE("Help translating this webpage.");
 echo "\">";
@@ -45,7 +43,7 @@
 W("Destination language: ");
 W($lang);
 P();
-echo "<form action=\"" . $i18nHTMLbase . "commitTranslation.php\">\n";
+echo "<form method="POST" action=\"" . $i18nHTMLbase . 
"commitTranslation.php\">\n";
 echo "<input type=hidden name=\"text\" value=\"" . urlencode($text) . "\">\n";
 echo "<input type=hidden name=\"xlang\" value=\"$xlang\">\n";
 echo "<input type=hidden name=\"back\" value=\"$back\">\n";
@@ -121,4 +119,4 @@
 generateFooter();
 echo "</body></html>";
 
-?>
\ No newline at end of file
+?>

Modified: i18nHTML/src/vote.php
===================================================================
--- i18nHTML/src/vote.php       2005-04-03 19:58:30 UTC (rev 582)
+++ i18nHTML/src/vote.php       2005-04-04 02:02:32 UTC (rev 583)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff
+     (C) 2003, 2004, 2005 Christian Grothoff
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -21,9 +21,10 @@
   // For sentences with multiple translations, the one with the most
   // votes is displayed.
 include("i18nhtml.inc");
-echo "<html><head><title>";
-W("WWW translation: vote");
-echo "</title></head><body>";
+echo "<html><head>";
+echo "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" >";
+TITLE("WWW translation: vote");
+echo "</head><body>";
 if (!$connection) {
   echo "Database is down. Cannot edit translations.";
   die();





reply via email to

[Prev in Thread] Current Thread [Next in Thread]