summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-06-08 16:50:05 +0000
committerDries Buytaert <dries@buytaert.net>2003-06-08 16:50:05 +0000
commita448f5a9b46c5a5e5bcd64072a420bef33161a44 (patch)
tree3b5ac996148f4e2b3547b45a671b00f0fbdb54ba
parentff914280b9cb8961b26556cb378329e6e3bfda55 (diff)
downloadbrdo-a448f5a9b46c5a5e5bcd64072a420bef33161a44.tar.gz
brdo-a448f5a9b46c5a5e5bcd64072a420bef33161a44.tar.bz2
- Charset simpliciations. Patch #46 by Al.
-rw-r--r--includes/common.inc4
-rw-r--r--includes/theme.inc2
-rw-r--r--modules/aggregator.module2
-rw-r--r--modules/aggregator/aggregator.module2
-rw-r--r--modules/import.module2
-rw-r--r--modules/node.module5
-rw-r--r--modules/node/node.module5
-rw-r--r--modules/system.module25
-rw-r--r--modules/system/system.module25
-rw-r--r--update.php7
10 files changed, 16 insertions, 63 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 9909da1a2..3b30032d0 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -203,7 +203,7 @@ function variable_del($name) {
}
function drupal_specialchars($input) {
- return htmlspecialchars($input, ENT_NOQUOTES, variable_get("site_charset", "iso-8859-1"));
+ return htmlspecialchars($input, ENT_NOQUOTES, "utf-8");
}
function table_cell($cell, $header = 0) {
@@ -1025,7 +1025,7 @@ $conf = variable_init(isset($conf) ? $conf : array());
set_error_handler("error_handler");
// spit out the correct charset http header
-header("Content-Type: text/html; charset=". variable_get("site_charset", "iso-8859-1"));
+header("Content-Type: text/html; charset=utf-8");
// initialize installed modules:
module_init();
diff --git a/includes/theme.inc b/includes/theme.inc
index dce4cff1b..643e39323 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -144,7 +144,7 @@ function theme_list($refresh = 0) {
function theme_head($main = 0) {
global $base_url;
- $output .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=". variable_get("site_charset", "iso-8859-1") ."\" />";
+ $output .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
$output .= "<base href=\"$base_url/\" />\n";
$output .= "<style type=\"text/css\">\n";
$output .= "@import url(misc/drupal.css);\n";
diff --git a/modules/aggregator.module b/modules/aggregator.module
index d7916491c..9eb9b1aa1 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -706,7 +706,7 @@ function import_page_fd() {
$result = db_query("SELECT * FROM feed ORDER BY title");
- $output .= "<?xml version=\"1.0\" encoding=\"". variable_get("site_charset", "iso-8859-1") ."\"?>\n\n";
+ $output .= "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n";
$output .= "<rssfeeds version=\"0.1\">\n\n";
while ($feed = db_fetch_object($result)) {
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index d7916491c..9eb9b1aa1 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -706,7 +706,7 @@ function import_page_fd() {
$result = db_query("SELECT * FROM feed ORDER BY title");
- $output .= "<?xml version=\"1.0\" encoding=\"". variable_get("site_charset", "iso-8859-1") ."\"?>\n\n";
+ $output .= "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n";
$output .= "<rssfeeds version=\"0.1\">\n\n";
while ($feed = db_fetch_object($result)) {
diff --git a/modules/import.module b/modules/import.module
index d7916491c..9eb9b1aa1 100644
--- a/modules/import.module
+++ b/modules/import.module
@@ -706,7 +706,7 @@ function import_page_fd() {
$result = db_query("SELECT * FROM feed ORDER BY title");
- $output .= "<?xml version=\"1.0\" encoding=\"". variable_get("site_charset", "iso-8859-1") ."\"?>\n\n";
+ $output .= "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n";
$output .= "<rssfeeds version=\"0.1\">\n\n";
while ($feed = db_fetch_object($result)) {
diff --git a/modules/node.module b/modules/node.module
index 1bbc95623..c62be185a 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -879,12 +879,11 @@ function node_feed($nodes = 0, $channel = array()) {
while ($node = db_fetch_object($nodes)) {
$item = node_load(array("nid" => $node->nid));
$link = url("node/view/$item->nid");
- $items .= format_rss_item($item->title, $link, $item->teaser);
+ $items .= format_rss_item($item->title, $link, ($item->teaser ? $item->teaser : $item->body));
}
- $output .= "<?xml version=\"1.0\" encoding=\"". variable_get("site_charset", "iso-8859-1") ."\"?>\n";
+ $output .= "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$output .= "<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">]>\n";
- // NOTE: &eacute; - for example - is the correct ISO-8859-1 translation of (e acute) but apparently XML parsers don't (have to) understand it. To solve this problem, we use a DTD that defines commonly used entity such as &eacute;.
if (!$channel["version"]) $channel["version"] = "0.91";
if (!$channel["title"]) $channel["title"] = variable_get("site_name", "drupal") ." - ". variable_get("site_slogan", "");
if (!$channel["link"]) $channel["link"] = $base_url;
diff --git a/modules/node/node.module b/modules/node/node.module
index 1bbc95623..c62be185a 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -879,12 +879,11 @@ function node_feed($nodes = 0, $channel = array()) {
while ($node = db_fetch_object($nodes)) {
$item = node_load(array("nid" => $node->nid));
$link = url("node/view/$item->nid");
- $items .= format_rss_item($item->title, $link, $item->teaser);
+ $items .= format_rss_item($item->title, $link, ($item->teaser ? $item->teaser : $item->body));
}
- $output .= "<?xml version=\"1.0\" encoding=\"". variable_get("site_charset", "iso-8859-1") ."\"?>\n";
+ $output .= "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$output .= "<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">]>\n";
- // NOTE: &eacute; - for example - is the correct ISO-8859-1 translation of (e acute) but apparently XML parsers don't (have to) understand it. To solve this problem, we use a DTD that defines commonly used entity such as &eacute;.
if (!$channel["version"]) $channel["version"] = "0.91";
if (!$channel["title"]) $channel["title"] = variable_get("site_name", "drupal") ." - ". variable_get("site_slogan", "");
if (!$channel["link"]) $channel["link"] = $base_url;
diff --git a/modules/system.module b/modules/system.module
index 801daa819..9834d7e05 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -129,31 +129,6 @@ function system_view_general() {
$output .= form_select(t("Date format (medium)"), "date_format_medium", variable_get("date_format_medium", $datemedium[0]), $datemediumchoices, t("The medium sized date display."));
$output .= form_select(t("Date format (long)"), "date_format_long", variable_get("date_format_long", $datelong[0]), $datelongchoices, t("Longer date format used for detailed display."));
- $output .= "<hr />\n";
-
- $output .= "<h3>". t("Character encoding settings") ."</h3>\n";
-
- // charset settings
- $charsets = array("iso-8859-1" => "iso-8859-1",
- "iso-8859-2" => "iso-8859-2",
- "iso-8859-3" => "iso-8859-3",
- "iso-8859-4" => "iso-8859-4",
- "iso-8859-5" => "iso-8859-5",
- "iso-8859-6" => "iso-8859-6",
- "iso-8859-7" => "iso-8859-7",
- "iso-8859-8" => "iso-8859-8",
- "iso-8859-8-i" => "iso-8859-8-i",
- "iso-8859-9" => "iso-8859-9",
- "utf-8" => "utf-8",
- "utf-16" => "utf-16",
- "utf-16be" => "utf-16be",
- "euc-kr" => "euc-kr",
- "koi8-r" => "koi8-r",
- "ks_c_5601-1987" => "ks_c_5601-1987",
- "tis-620" => "tis-620",
- "iso-2022-kr" => "iso-2022-kr",
- "us-ascii" => "us-ascii");
- $output .= form_select(t("Character set"), "site_charset", variable_get("site_charset", "iso-8859-1"), $charsets, t("Select the character set (charset) used across your site. This will affect the content-type tag in web pages and the XML declarations in RSS feeds, among other things. You probably only need to change this if you need support for languages with non-ASCII characters like Korean, Polish, etc."));
return $output;
}
diff --git a/modules/system/system.module b/modules/system/system.module
index 801daa819..9834d7e05 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -129,31 +129,6 @@ function system_view_general() {
$output .= form_select(t("Date format (medium)"), "date_format_medium", variable_get("date_format_medium", $datemedium[0]), $datemediumchoices, t("The medium sized date display."));
$output .= form_select(t("Date format (long)"), "date_format_long", variable_get("date_format_long", $datelong[0]), $datelongchoices, t("Longer date format used for detailed display."));
- $output .= "<hr />\n";
-
- $output .= "<h3>". t("Character encoding settings") ."</h3>\n";
-
- // charset settings
- $charsets = array("iso-8859-1" => "iso-8859-1",
- "iso-8859-2" => "iso-8859-2",
- "iso-8859-3" => "iso-8859-3",
- "iso-8859-4" => "iso-8859-4",
- "iso-8859-5" => "iso-8859-5",
- "iso-8859-6" => "iso-8859-6",
- "iso-8859-7" => "iso-8859-7",
- "iso-8859-8" => "iso-8859-8",
- "iso-8859-8-i" => "iso-8859-8-i",
- "iso-8859-9" => "iso-8859-9",
- "utf-8" => "utf-8",
- "utf-16" => "utf-16",
- "utf-16be" => "utf-16be",
- "euc-kr" => "euc-kr",
- "koi8-r" => "koi8-r",
- "ks_c_5601-1987" => "ks_c_5601-1987",
- "tis-620" => "tis-620",
- "iso-2022-kr" => "iso-2022-kr",
- "us-ascii" => "us-ascii");
- $output .= form_select(t("Character set"), "site_charset", variable_get("site_charset", "iso-8859-1"), $charsets, t("Select the character set (charset) used across your site. This will affect the content-type tag in web pages and the XML declarations in RSS feeds, among other things. You probably only need to change this if you need support for languages with non-ASCII characters like Korean, Polish, etc."));
return $output;
}
diff --git a/update.php b/update.php
index 81e1bac04..16f5a4361 100644
--- a/update.php
+++ b/update.php
@@ -68,7 +68,8 @@ $mysql_updates = array(
"2003-05-18" => "update_53",
"2003-05-24" => "update_54",
"2003-05-31" => "update_55",
- "2003-06-04" => "update_56"
+ "2003-06-04" => "update_56",
+ "2003-06-08" => "update_57"
);
// Update functions
@@ -725,6 +726,10 @@ function update_56() {
update_sql("ALTER TABLE vocabulary CHANGE types nodes TEXT DEFAULT '' NOT NULL");
}
+function update_57() {
+ update_sql("DELETE FROM variable WHERE name = 'site_charset'");
+}
+
function update_upgrade3() {
update_sql("INSERT INTO system VALUES ('archive.module','archive','module','',1)");
update_sql("INSERT INTO system VALUES ('block.module','block','module','',1)");