summaryrefslogtreecommitdiff
path: root/_test/cases/inc/utf8_utf16be.test.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-10-17 22:04:31 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-10-17 22:04:31 +0200
commit15fa0b4f1d7eb4b260ff5b8025c56fce3681148e (patch)
treeeb71f504982f49e497ada40bbbac35b24383a72a /_test/cases/inc/utf8_utf16be.test.php
parentfaa28b7fc56238d32739d949fd2df3bffe33b1ba (diff)
downloadrpg-15fa0b4f1d7eb4b260ff5b8025c56fce3681148e.tar.gz
rpg-15fa0b4f1d7eb4b260ff5b8025c56fce3681148e.tar.bz2
removed mb_string requirement in JSON.php #592
darcs-hash:20051017200431-7ad00-c9ed74326a44b078cc516e08515375d9d0fba811.gz
Diffstat (limited to '_test/cases/inc/utf8_utf16be.test.php')
-rw-r--r--_test/cases/inc/utf8_utf16be.test.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/_test/cases/inc/utf8_utf16be.test.php b/_test/cases/inc/utf8_utf16be.test.php
new file mode 100644
index 000000000..2d79ca35a
--- /dev/null
+++ b/_test/cases/inc/utf8_utf16be.test.php
@@ -0,0 +1,28 @@
+<?php
+
+require_once DOKU_INC.'inc/utf8.php';
+
+// use no mbstring help here
+define('UTF8_NOMBSTRING',1);
+
+class utf8_utf16be_test extends UnitTestCase {
+ // some chars from various code regions
+ var $utf8 = '鈩ℵŁöx';
+ var $utf16 = "\x92\x29\x21\x35\x1\x41\x0\xf6\x0\x78";
+
+ /**
+ * Convert from UTF-8 to UTF-16BE
+ */
+ function test_to16be(){
+ $this->assertEqual(utf8_to_utf16be($this->utf8), $this->utf16);
+ }
+
+ /**
+ * Convert from UTF-16BE to UTF-8
+ */
+ function test_from16be(){
+ $this->assertEqual(utf16be_to_utf8($this->utf16),$this->utf8);
+ }
+}
+
+//Setup VIM: ex: et ts=2 enc=utf-8 :