|
楼主 |
发表于 2004-10-24 22:39:51
|
显示全部楼层
来自 中国–新疆–乌鲁木齐
可能金兄误解我的意思了,你试一下这一段代码
#include <amxmod>
public amx_showch(id){
new g_Buffer[2048]
new pos
pos = copy(g_Buffer,2047,"<html><head></head><body bgcolor='#000000' text='#FFB000'>")
copy(g_Buffer[pos],2047-pos,"测试中文</body></html>")
show_motd(id,g_Buffer,"Ip")
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin("test","0.8","chinese")
register_clcmd("say /testp","amx_showch")
return PLUGIN_CONTINUE
}
出来的是乱码!!如何解决??
刚才想了一下加了一句
<meta http-equiv='content-type' content='text/html; charset=UTF-8'>")
就好了
#include <amxmod>
public amx_showch(id){
new g_Buffer[2048]
new pos
pos = copy(g_Buffer,2047,"<html><head></head><body bgcolor='#000000' text='#FFB000'> <meta http-equiv='content-type' content='text/html; charset=UTF-8'>")
copy(g_Buffer[pos],2047-pos,"测试中文</body></html>")
show_motd(id,g_Buffer,"Ip")
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin("test","0.8","chinese")
register_clcmd("say /testp","amx_showch")
return PLUGIN_CONTINUE
} |
|