Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9773
Modified Files:
NEWS index.php serendipity_config.inc.php
Log Message:
Allow for each language to have its own charset
Should finish support for russian and other languages not using ISO-8859-1
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- NEWS 25 Feb 2004 13:57:05 -0000 1.77
+++ NEWS 25 Feb 2004 17:42:48 -0000 1.78
@@ -2,6 +2,7 @@
Version 0.5.1 ()
------------------------------------
+ * Allow for each language to have its own charset (tomsommer)
* Now able to preview comments. (garvinhicking)
* Fixed bug that removed admin-cookie when you didn't check the "remember comment" box on submitting comments to your own blog (garvinhicking)
* Conditional GET logic for RSS feeds using HTTP caching methods. See README for instructions, needs database schema update [db_update-0.5-0.5.1.sql] (garvinhicking)
Index: index.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/index.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- index.php 25 Feb 2004 10:50:41 -0000 1.32
+++ index.php 25 Feb 2004 17:42:48 -0000 1.33
@@ -19,7 +19,7 @@
}
if (preg_match('@/archives/(\d+)\.html@', $uri, $matches)) {
- header('Content-Type: text/html; charset=ISO-8859-1');
+ header('Content-Type: text/html; charset='. LANG_CHARSET);
$range = $matches[1];
$_GET['serendipity']['action'] = 'read';
$_GET['serendipity']['range'] = $range;
@@ -45,7 +45,7 @@
echo $data;
} else if (preg_match('@/archives/(\d+)_short\.html@', $uri, $matches)) {
- header('Content-Type: text/html; charset=ISO-8859-1');
+ header('Content-Type: text/html; charset='. LANG_CHARSET);
$range = $matches[1];
$_GET['serendipity']['action'] = 'read';
$_GET['serendipity']['range'] = $range;
@@ -89,7 +89,7 @@
}
}
- header('Content-Type: text/html; charset=ISO-8859-1');
+ header('Content-Type: text/html; charset='. LANG_CHARSET);
$id = $matches[1];
serendipity_track_referrer($id);
@@ -146,14 +146,14 @@
header("Location: {$serendipity['serendipityHTTPPath']}serendipity_entries.php");
exit;
} else if (preg_match('@/archive$@', $uri)) {
- header('Content-Type: text/html; charset=ISO-8859-1');
+ header('Content-Type: text/html; charset='. LANG_CHARSET);
$serendipity['GET']['action'] = 'archives';
include_once('serendipity_genpage.inc.php');
} else if (preg_match('@/categories/(.*)@', $uri, $matches) ||
preg_match('@/(index\.(php|html))?@', $uri) ||
preg_match('@/(' . preg_quote($serendipity['indexFile']) . ')?@', $uri)) {
- header('Content-Type: text/html; charset=ISO-8859-1');
+ header('Content-Type: text/html; charset='. LANG_CHARSET);
if (count($serendipity['GET']) == 2) {
if (isset($matches) && is_array($matches) && isset($matches[1])) {
Index: serendipity_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- serendipity_config.inc.php 25 Feb 2004 10:50:41 -0000 1.52
+++ serendipity_config.inc.php 25 Feb 2004 17:42:48 -0000 1.53
@@ -96,6 +96,11 @@
}
}
+/*
+ * Fallback charset, if none is defined in the language files
+ */
+@define('LANG_CHARSET', 'ISO-8859-1');
+
if ($serendipity['embed'] && ($serendipity['embed'] === 'true' || $serendipity['embed'] === true)) {
$serendipity['baseURL'] = 'http://' . $_SERVER['HTTP_HOST'] . $serendipity['serendipityHTTPPath'];
|