/** * Test for PMA_Kanji_checkEncoding * * @param string $encoding Encoding to set * @param string $expected Expected encoding list * * @return void * @test * @dataProvider checkEncodingData */ public function testCheckEncoding($encoding, $expected) { mb_internal_encoding($encoding); $this->assertTrue(PMA_Kanji_checkEncoding()); $this->assertEquals($expected, $GLOBALS['kanji_encoding_list']); }
} $tmpfname = tempnam('', $enc); $fpd = fopen($tmpfname, 'wb'); $fps = fopen($file, 'r'); PMA_Kanji_changeOrder(); while (!feof($fps)) { $line = fgets($fps, 4096); $dist = PMA_Kanji_strConv($line, $enc, $kana); fputs($fpd, $dist); } // end while PMA_Kanji_changeOrder(); fclose($fps); fclose($fpd); unlink($file); return $tmpfname; } // end of the 'PMA_Kanji_fileConv' function /** * Defines radio form fields to switch between encoding modes * 2002/1/4 by Y.Kawada * * @return string xhtml code for the radio controls */ function PMA_Kanji_encodingForm() { return "\n" . '<ul>' . "\n" . '<li>' . '<input type="radio" name="knjenc" value="" checked="checked" ' . 'id="kj-none" />' . '<label for="kj-none">' . _pgettext('None encoding conversion', 'None') . "</label>\n" . '<input type="radio" name="knjenc" value="EUC-JP" id="kj-euc" />' . '<label for="kj-euc">EUC</label>' . "\n" . '<input type="radio" name="knjenc" value="SJIS" id="kj-sjis" />' . '<label for="kj-sjis">SJIS</label>' . "\n" . '</li>' . "\n" . '<li>' . '<input type="checkbox" name="xkana" value="kana" id="kj-kana" />' . "\n" . '<label for="kj-kana">' . __('Convert to Kana') . '</label><br />' . "\n" . '</li>' . "\n" . '</ul>'; } // end of the 'PMA_Kanji_encodingForm' function PMA_Kanji_checkEncoding();