- 论坛徽章:
- 1
|
<font size=4>;<b>;Make your GB file to Big5 file</b>;</font>;
<font size=2>owered by zyme. Welcome to www.ipisu.com.</font>;<br>;<br>;
<form action='<?$php_self;?>;' method=post>;
The GB file:<input name='srcfile'>;
<input type=submit value='Make!'>;
</form>;
<?php //Powered by zyme //Welcome to www.ipisu.com
if($srcfile!=""
{
///////////////
//----------------
$mb_file="hc.tab";
$d_big5_er="^";
$gb_file=$srcfile;
$big5_file=time()."big5_file";
//----------------
if(!fopen($gb_file,"r"){echo"<br>;<br>;<font color=red size=4>;The $gb_file file is not ready!</font>;";exit;}
if(!fopen($mb_file,"r"){echo"<br>;<br>;<font color=red size=4>;The $mb_file file is not ready!</font>;";exit;}
$mb_fl=file($mb_file);
$gb_fl=file($gb_file);
for($a=0;$gb_fl[$a];$a++)
{
$gb_l_len=strlen($gb_fl[$a]);
for($b=0;$b<=$gb_l_len;$b++)
{
$o_w=substr($gb_fl[$a],$b,1);
if(ord($o_w)>;12
{
$o_w=substr($gb_fl[$a],$b,2);
for($c=0;$mb_fl[$c];$c++)
{
if($o_w==substr($mb_fl[$c],0,2))
{
$n_w=substr($mb_fl[$c],2,-1);
if(strlen($n_w)>;2)
{
$n_w=$d_big5_er.$n_w.$d_big5_er;
}
break;
}
else if(!$mb_fl[$c+1])
{
$n_w=$o_w;
}
}
$b++;
}
else
{
$n_w=$o_w;
}
$big5_fl[$a]=$big5_fl[$a].$n_w;
}
$big5_src=$big5_src.$big5_fl[$a];
}
//--------------
$fp=fopen($big5_file,"w+"
fwrite($fp,$big5_src);
//--------------
echo"<br>;<br>;Complete! <a href=$big5_file>;Visit the big5 file now!</a>;";
////////////////
}
?>; |
|