00001 <?php
00002 require_once  dirname(__FILE__) . '/../../../3rdparty/idna_convert/idna_convert.class.php';
00003 
00004 
00005 
00006 
00007 
00008 
00009  
00010 class ConverterPunycode implements IConverter {
00011         public function encode($value, $params = false) {
00012                 $inst = $this->create_converter();
00013                 $ret = false;
00014                 if ($inst) {
00015                         $ret = $inst->encode(trim($value));
00016                 }
00017                 return $ret;
00018         }
00019         
00020         public function decode($value, $params = false) {
00021                 $inst = $this->create_converter();
00022                 $ret = false;
00023                 if ($inst) {
00024                         $ret = $inst->decode(trim($value));
00025                 }
00026                 return $ret;            
00027         }       
00028         
00029         private function create_converter() {
00030                 return new idna_convert();
00031         }
00032 }