summaryrefslogtreecommitdiff
path: root/itjs.class
diff options
context:
space:
mode:
authorThomas BrĂ¼derli2007-08-28 07:46:24 +0000
committerThomas BrĂ¼derli2007-08-28 07:46:24 +0000
commitae17c5f249a6f8f810bd583ca022d6052d95400e (patch)
treef52513820351b5a9af65838bae0b5de240f38cdd /itjs.class
parentb08a2b29fd69cc8f5b22eabc830281f38b821c1b (diff)
downloaditools-ae17c5f249a6f8f810bd583ca022d6052d95400e.tar.gz
itools-ae17c5f249a6f8f810bd583ca022d6052d95400e.tar.bz2
itools-ae17c5f249a6f8f810bd583ca022d6052d95400e.zip
Some browsers still report invalid chars. Use \uxxxx for non-ascii chars
Diffstat (limited to 'itjs.class')
-rw-r--r--itjs.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/itjs.class b/itjs.class
index c0a8ef3..86e9e86 100644
--- a/itjs.class
+++ b/itjs.class
@@ -72,7 +72,7 @@ function encode($values)
else if (!is_array($value))
{
$quote = (strval(intval($value)) === strval($value)) ? "" : '"';
- $result .= $quote . preg_replace('/([\xa0-\xff])/e', 'sprintf("\\x%02x", ord("\\1"))', strtr($value, array("\0" => '\\0', '"' => '\\"', "</"=>"<\\/", "\n" => '\\n', "\r" => '\\r', "\t" => '\\t', "\\" => '\\\\'))) . $quote;
+ $result .= $quote . preg_replace('/([\xa0-\xff])/e', 'sprintf("\\u%04x", ord("\\1"))', strtr($value, array("\0" => '\\0', '"' => '\\"', "</"=>"<\\/", "\n" => '\\n', "\r" => '\\r', "\t" => '\\t', "\\" => '\\\\'))) . $quote;
}
else
$result .= itjs::encode($value);