From 774a78dbded6a8897939fc33d3d5a39079e658dd Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Tue, 5 Feb 2013 23:02:13 -0700 Subject: [PATCH] better unicode support in xmlify --- include/text.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/text.php b/include/text.php index 7163a66404..03ff32cff9 100644 --- a/include/text.php +++ b/include/text.php @@ -175,9 +175,8 @@ if(! function_exists('xmlify')) { function xmlify($str) { $buffer = ''; - $len = mb_strlen($str); - for($x = 0; $x < $len; $x ++) { - $char = $str[$x]; + $str_array = preg_split('//u', $str, -1, PREG_SPLIT_NO_EMPTY); + foreach($str_array as $char) { switch( $char ) { -- 2.39.5