<?php  
//UTF8编码 
require('xiaoi.php');   
$i = new XiaoI();   
while(1)   
{   
    echo 'me: ';   
    $s = trim(fgets(STDIN));   
    $s = iconv('gb2312', 'utf-8', $s);   
    echo 'xiaoi: '.iconv('utf-8', 'gb2312', $i->chat($s))."\n";   
}  
