cvs: docweb /scripts rev.php
| From: | Nuno Lopes | Date: | Wed, 26 Jan 2005 17:23:25 +0000 |
| Subject: | cvs: docweb /scripts rev.php | ||
| Groups: | php.doc.web | ||
| Request: | Send a blank email to doc-web+get-580@lists.php.net to get a copy of this message | ||
nlopess Wed Jan 26 12:23:25 2005 EDT
Modified files:
/docweb/scripts rev.php
Log:
convert intro and translator names to UTF-8
http://cvs.php.net/diff.php/docweb/scripts/rev.php?r1=1.14&r2=1.15&ty=u
Index: docweb/scripts/rev.php
diff -u docweb/scripts/rev.php:1.14 docweb/scripts/rev.php:1.15
--- docweb/scripts/rev.php:1.14 Fri Nov 5 04:41:58 2004
+++ docweb/scripts/rev.php Wed Jan 26 12:23:24 2005
@@ -70,7 +70,7 @@
exit(0);
}
-$DOCS = CVS_DIR . get_cvs_dir($TYPE);
+$DOCS = CVS_DIR . '/' . get_cvs_dir($TYPE);
// $argv was shifted before
$LANGS = $argv;
@@ -171,11 +171,6 @@
$txml = join("", file($translation_xml));
$txml = preg_replace("/\\s+/", " ", $txml);
- // Get intro text
- if (preg_match("!<intro>(.+)</intro>!s", $txml, $match)) {
- $intro = trim($match[1]);
- }
-
// Get encoding for the output, from the translation.xml
// file encoding (should be the same as the used encoding
// in HTML)
@@ -185,6 +180,11 @@
$charset = $xmlinfo[1]["encoding"];
}
}
+
+ // Get intro text
+ if (preg_match("!<intro>(.+)</intro>!s", $txml, $match)) {
+ $intro = @iconv($charset, 'UTF-8//IGNORE', trim($match[1]));
+ }
}
$SQL_BUFF .= "INSERT INTO description VALUES ('$lang', '" .
sqlite_escape_string($intro) . "', DATE(), '$charset');\n";
@@ -197,7 +197,7 @@
foreach ($persons as $person) {
$person = array_merge($default, $person);
- $SQL_BUFF .= "INSERT INTO translators VALUES ('$lang', '"
. sqlite_escape_string($person['nick']) . "', '" .
sqlite_escape_string($person['name']) . "', '" .
sqlite_escape_string($person['email']) . "', '" .
sqlite_escape_string($person['cvs']) . "', '" .
sqlite_escape_string($person['editor']) . "');\n";
+ $SQL_BUFF .= "INSERT INTO translators VALUES ('$lang', '"
. sqlite_escape_string($person['nick']) . "', '" .
sqlite_escape_string(@iconv($charset, 'UTF-8//IGNORE', $person['name'])) .
"', '" . sqlite_escape_string($person['email']) . "',
'" . sqlite_escape_string($person['cvs']) . "', '" .
sqlite_escape_string($person['editor']) . "');\n";
}
}