示例#1
0
 public function testLegacy_a_unicode()
 {
     $lu = 'wkw5';
     $arru = array(0xe1, 0x90, 0x83, 0xe1, 0x93, 0x84, 0xe1, 0x90, 0x83, 0xe1, 0x91, 0xa6);
     $au = implode('', array_map('chr', $arru));
     $ru = Nunacom::legacyToUnicode($lu, FALSE);
     $this->assertEquals($au, $ru);
 }
示例#2
0
 function transcodeFromLegacy($fromFormat, $toFormat, $aipaitai, $text)
 {
     switch ($fromFormat) {
         case 'nunacom':
             $transcodedText = Nunacom::legacyToUnicode($text, FALSE);
             $transcodedText = $this->transcodeFromUnicode($toFormat, $aipaitai, $transcodedText);
             break;
         case 'prosyl':
             $transcodedText = Prosyl::legacyToUnicode($text, FALSE);
             $transcodedText = $this->transcodeFromUnicode($toFormat, $aipaitai, $transcodedText);
             break;
         case 'aipainunavik':
             $transcodedText = Aipainunavik::legacyToUnicode($text, '-');
             $transcodedText = $this->transcodeFromUnicode($toFormat, '-', $transcodedText);
             break;
     }
     return $transcodedText;
 }