Exemplo n.º 1
0
 public function testUnicode_ici_a_aipaitai()
 {
     $unicodes = array(0x1455, 0x1403, 0x14aa);
     // taima
     $ici = utf8::numeric_to_utf8($unicodes);
     $aipaitai = Syllabics::iciUnicodeToLatinAlphabet($ici);
     $attCodes = array(0x144c, 0x14aa);
     // taima en aipaitai
     $att = utf8::numeric_to_utf8($attCodes);
     $this->assertEquals($att, $aipaitai, "Erreur");
 }
Exemplo n.º 2
0
 function transcodeFromUnicode($toFormat, $aipaitai, $text)
 {
     $logger = Logger::getLogger('transcodeFromUnicode');
     $logger->debug("\$toFormat= '{$toFormat}'");
     $logger->debug("\$text= '{$text}'");
     $transcodedText = "";
     switch ($toFormat) {
         case 'roman alphabet':
             $transcodedText = Syllabics::unicodeToLatinAlphabet($text);
             break;
         case 'unicode':
             switch ($aipaitai) {
                 case '1':
                     $transcodedText = Syllabics::iciUnicodeToLatinAlphabet($text);
                     break;
                 case '0':
                     $transcodedText = Syllabics::iciUnicodeToNoAipaitai($text);
                     break;
                 default:
                     $transcodedText = $text;
                     break;
             }
             break;
         case 'unicode &#xxxx;':
             switch ($aipaitai) {
                 case '1':
                     $transcodedText = Syllabics::iciUnicodeToLatinAlphabet($text);
                     break;
                 case '0':
                     $transcodedText = Syllabics::iciUnicodeToNoAipaitai($text);
                     break;
                 default:
                     $transcodedText = $text;
                     break;
             }
             $transcodedText = $this->unicodeToHTMLEntity($transcodedText);
             break;
         case 'unicode \\uxxxx':
             switch ($aipaitai) {
                 case '1':
                     $transcodedText = Syllabics::iciUnicodeToLatinAlphabet($text);
                     break;
                 case '0':
                     $transcodedText = Syllabics::iciUnicodeToNoAipaitai($text);
                     break;
                 default:
                     $transcodedText = $text;
                     break;
             }
             $transcodedText = $this->unicodeToSlashUUnicodeString($transcodedText);
             break;
         case 'unicode url encoding %xx':
             switch ($aipaitai) {
                 case '1':
                     $transcodedText = Syllabics::iciUnicodeToLatinAlphabet($text);
                     break;
                 case '0':
                     $transcodedText = Syllabics::iciUnicodeToNoAipaitai($text);
                     break;
                 default:
                     $transcodedText = $text;
                     break;
             }
             $transcodedText = $this->unicodeToURLEncoding($transcodedText);
             break;
         case 'nunacom':
             $transcodedText = Nunacom::unicodeToLegacy($text);
             break;
         case 'prosyl':
             $transcodedText = Prosyl::unicodeToLegacy($text);
             break;
         case 'aipainunavik':
             $transcodedText = Aipainunavik::unicodeToLegacy($text);
             break;
     }
     return $transcodedText;
 }