summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-01-25 19:48:55 +0100
committerandi <andi@splitbrain.org>2005-01-25 19:48:55 +0100
commit0c59b0cf929e1226a31e238856ee99b0889aeaf3 (patch)
treef71adbea4bf894dc0cc85f8449a10fd936793125
parent98f1fd231d98f1645ecc4f3e99bae609428b90fb (diff)
downloadrpg-0c59b0cf929e1226a31e238856ee99b0889aeaf3.tar.gz
rpg-0c59b0cf929e1226a31e238856ee99b0889aeaf3.tar.bz2
more deaccenting
darcs-hash:20050125184855-9977f-bcb8c1e22c8814d1d9b2c65a5673dae5ef7d86e4.gz
-rw-r--r--inc/common.php24
-rw-r--r--inc/utf8.php8
2 files changed, 3 insertions, 29 deletions
diff --git a/inc/common.php b/inc/common.php
index d756b914d..7700a71c9 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -418,29 +418,7 @@ function cleanID($id){
if($conf['deaccent']) $id = utf8_deaccent($id,-1);
//remove specials (only ascii specials are removed)
- $id = preg_replace('#[ !"§$%&()\[\]{}\\?`\'\#~*+=,<>\|^°@µ¹²³¼½¬]#u','_',$id);
-
-/* DELETEME legacy code
- if(!$conf['localnames']){
- if($lang['encoding'] == 'iso-8859-15'){
- // replace accented chars with unaccented ones
- // this may look strange on your terminal - just don't touch
- $id = strtr(
- strtr($id,
- 'ŠŽšžŸÀÁÂÃÅÇÈÉÊËÌÍÎÏÑÒÓÔÕØÙÚÛÝàáâãåçèéêëìíîïñòóôõøùúûýÿ',
- 'szszyaaaaaceeeeiiiinooooouuuyaaaaaceeeeiiiinooooouuuyy'),
- array('Þ' => 'th', 'þ' => 'th', 'Ð' => 'dh', 'ð' => 'dh', 'ß' => 'ss',
- 'Œ' => 'oe', 'œ' => 'oe', 'Æ' => 'ae', 'æ' => 'ae', 'µ' => 'u',
- 'ü' => 'ue', 'ö' => 'oe', 'ä' => 'ae', 'Ü' => 'ue', 'Ö' => 'ö',
- 'Ä' => 'ae'));
- }
- $WORD = 'a-z';
- }else{
- $WORD = '\w';
- }
- //special chars left will be converted to _
- $id = preg_replace('#[^'.$WORD.'0-9:\-\.]#','_',$id);
-*/
+ $id = preg_replace('#[0x00-0x20 !"§$%&()\[\]{}\\?`\'\#~*+=,<>\|^°@µ¹²³¼½¬]#u','_',$id);
//clean up
$id = preg_replace('#__#','_',$id);
diff --git a/inc/utf8.php b/inc/utf8.php
index 80b85637b..1d2676688 100644
--- a/inc/utf8.php
+++ b/inc/utf8.php
@@ -322,8 +322,6 @@ $UTF8_UPPER_TO_LOWER = @array_flip($UTF8_LOWER_TO_UPPER);
* This lookuptable defines replacements for accented characters from the ASCII-7
* range. This are lower case letters only.
*
- * FIXME missing chars eg: æ
- *
* @author Andreas Gohr <andi@splitbrain.org>
* @see utf8_deaccent()
*/
@@ -342,7 +340,7 @@ $UTF8_LOWER_ACCENTS = array(
'ÿ' => 'y', 'ũ' => 'u', 'ŭ' => 'u', 'ư' => 'u', 'ţ' => 't', 'ý' => 'y', 'ő' => 'o',
'â' => 'a', 'ľ' => 'l', 'ẅ' => 'w', 'ż' => 'z', 'ī' => 'i', 'ã' => 'a', 'ġ' => 'g',
'ṁ' => 'm', 'ō' => 'o', 'ĩ' => 'i', 'ù' => 'u', 'į' => 'i', 'ź' => 'z', 'á' => 'a',
- 'û' => 'u',
+ 'û' => 'u', 'þ' => 'th', 'ð' => 'dh', 'æ' => 'ae', 'µ' => 'u',
);
/**
@@ -351,8 +349,6 @@ $UTF8_LOWER_ACCENTS = array(
* This lookuptable defines replacements for accented characters from the ASCII-7
* range. This are upper case letters only.
*
- * FIXME missing chars eg: æ
- *
* @author Andreas Gohr <andi@splitbrain.org>
* @see utf8_deaccent()
*/
@@ -371,7 +367,7 @@ $UTF8_UPPER_ACCENTS = array(
'ÿ' => 'Y', 'ũ' => 'U', 'ŭ' => 'U', 'ư' => 'U', 'ţ' => 'T', 'ý' => 'Y', 'ő' => 'O',
'â' => 'A', 'ľ' => 'L', 'ẅ' => 'W', 'ż' => 'Z', 'ī' => 'I', 'ã' => 'A', 'ġ' => 'G',
'ṁ' => 'M', 'ō' => 'O', 'ĩ' => 'I', 'ù' => 'U', 'į' => 'I', 'ź' => 'Z', 'á' => 'A',
- 'û' => 'U',
+ 'û' => 'U', 'Þ' => 'th', 'Ð' => 'dh', 'Æ' => 'ae',
);
?>