summaryrefslogtreecommitdiff
path: root/_test/cases/inc/utf8_utf16be.test.php
blob: 3a346da51e31e9c975d32aebd73b535c2c7f44bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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 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 :