diff options
author | andi <andi@splitbrain.org> | 2005-02-27 10:41:02 +0100 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-02-27 10:41:02 +0100 |
commit | e1906e6eda8098573a47fc7c78663348500920bd (patch) | |
tree | 9a048b9260ed7bb44fea63733d572e5a52c582c6 /inc/utf8.php | |
parent | 074cf26b87d427287e6179f51b9e64c2b1e88ac2 (diff) | |
download | rpg-e1906e6eda8098573a47fc7c78663348500920bd.tar.gz rpg-e1906e6eda8098573a47fc7c78663348500920bd.tar.bz2 |
better mailheader handling #168
darcs-hash:20050227094102-9977f-a481ce76ccdb40f8eaa762a332b93093de8f7a87.gz
Diffstat (limited to 'inc/utf8.php')
-rw-r--r-- | inc/utf8.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/inc/utf8.php b/inc/utf8.php index 4fee844d6..9fc99820e 100644 --- a/inc/utf8.php +++ b/inc/utf8.php @@ -54,6 +54,23 @@ function utf8_isASCII($str){ } /** + * Strips all highbyte chars + * + * Returns a pure ASCII7 string + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function utf8_strip($str){ + $ascii = ''; + for($i=0; $i<strlen($str); $i++){ + if(ord($str{$i}) <128){ + $ascii .= $str{$i}; + } + } + return $ascii; +} + +/** * Tries to detect if a string is in Unicode encoding * * @author <bmorel@ssi.fr> |