summaryrefslogtreecommitdiff
path: root/_test/tests/inc/utf8_utf16be.test.php
diff options
context:
space:
mode:
authorTobias Sarnowski <sarnowski@cosmocode.de>2012-04-18 12:08:28 +0200
committerTobias Sarnowski <sarnowski@cosmocode.de>2012-04-18 12:08:28 +0200
commitf8369d7d6e37248d6523fdac6e1d760fca4f1b52 (patch)
tree0848c213ffc191a23b55f07bd2ec55e777ea79ca /_test/tests/inc/utf8_utf16be.test.php
parentd59108b91e9bf9fd56dc2e697cf31f9bbc7f9cd4 (diff)
downloadrpg-f8369d7d6e37248d6523fdac6e1d760fca4f1b52.tar.gz
rpg-f8369d7d6e37248d6523fdac6e1d760fca4f1b52.tar.bz2
moved _testing to _test
Diffstat (limited to '_test/tests/inc/utf8_utf16be.test.php')
-rw-r--r--_test/tests/inc/utf8_utf16be.test.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/_test/tests/inc/utf8_utf16be.test.php b/_test/tests/inc/utf8_utf16be.test.php
new file mode 100644
index 000000000..0150a8e4a
--- /dev/null
+++ b/_test/tests/inc/utf8_utf16be.test.php
@@ -0,0 +1,28 @@
+<?php
+
+require_once DOKU_INC.'inc/utf8.php';
+
+// use no mbstring help here
+if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1);
+
+class utf8_utf16be_test extends DokuWikiTest {
+ // 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->assertEquals(utf8_to_utf16be($this->utf8), $this->utf16);
+ }
+
+ /**
+ * Convert from UTF-16BE to UTF-8
+ */
+ function test_from16be(){
+ $this->assertEquals(utf16be_to_utf8($this->utf16),$this->utf8);
+ }
+}
+
+//Setup VIM: ex: et ts=2 :