- 精华
- 阅读权限
- 110
- 好友
- 相册
- 分享
- 听众
- 收听
- 注册时间
- 2007-9-3
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
发表于 2011-11-25 15:06:53
|
显示全部楼层
本帖最后由 liou8600 于 2011-11-25 15:24 编辑
ru486 发表于 2011-11-25 14:29 
這樣就變成了更換系統語系
而不是更改遊戲本身的語系(GB2312 變成 UTF8 或 BIG5 )
這樣不就跟主題毫不相 ...
你是要更改游戏的语系??这游戏是简体服务端,你需要转繁体。
如果只需要客户端显示为繁体,在后台系统管理改变语言版本为2就是繁体了。想要改全端为繁体需要将服务端脚本改写函数
1、利用javascript在客户端进行转换。
2、利用php的ob功能,在服务器端转换
<?php
function isgb($code) {
if (strlen($code)> =2) {
$code=strtok($code, " ");
if ((ord($code[0]) < 161)||(ord($code[0]) > = 247)) {
return (0);
}
else {
if ((ord($code[1]) <= 161)||(ord($code[1]) > = 254)) {
return (0);
}
else {
return (1);
}
}
}
else{
return (1);
}
}
function gboffset($code) {
if (strlen($code) > = 2) {
$code=strtok($code, " ");
return ((ord($code[0]) - 161) * 94 + (ord($code[1]) - 161));
}
else {
return(-1);
}
}
function wordtostring($code) {
return (chr(hexdec(substr($code,0,2))).chr(hexdec(substr($code,2,2))));
}
function gbtobig5($code) {
include "data_gb.php ";
$output= " ";
$length=strlen($code);
$code=strtok($code, " ");
$idx=0;
while ($idx < $length) {
$tmpStr=$code[$idx].$code[$idx+1];
if (isgb($tmpStr)) {
$offset=gboffset($tmpStr);
if (($offset > = 0)||($offset <= 8177)) {
$output.=wordtostring($gborder[$offset]);
$idx++;
}
else {
$output.= $code[$idx];
}
}
else {
$output.= $code[$idx];
}
$idx++;
}
return ($output);
};
?>
这只是文字简繁转换函数,看你水平了,弄起来很麻烦
然后保存,更换管理器的语言包 |
|