diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-06-08 16:50:05 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-06-08 16:50:05 +0000 |
commit | a448f5a9b46c5a5e5bcd64072a420bef33161a44 (patch) | |
tree | 3b5ac996148f4e2b3547b45a671b00f0fbdb54ba /modules | |
parent | ff914280b9cb8961b26556cb378329e6e3bfda55 (diff) | |
download | brdo-a448f5a9b46c5a5e5bcd64072a420bef33161a44.tar.gz brdo-a448f5a9b46c5a5e5bcd64072a420bef33161a44.tar.bz2 |
- Charset simpliciations. Patch #46 by Al.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/aggregator.module | 2 | ||||
-rw-r--r-- | modules/aggregator/aggregator.module | 2 | ||||
-rw-r--r-- | modules/import.module | 2 | ||||
-rw-r--r-- | modules/node.module | 5 | ||||
-rw-r--r-- | modules/node/node.module | 5 | ||||
-rw-r--r-- | modules/system.module | 25 | ||||
-rw-r--r-- | modules/system/system.module | 25 |
7 files changed, 7 insertions, 59 deletions
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: é - 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 é. 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: é - 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 é. 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; } |