引用 | 编辑
z1022001
2016-11-13 16:12 |
楼主
▼ |
||
x0
请问一下有没有人有给 UTF-8 编码用的 equal 的 code我记得之前在国外论坛有看到相关的源码, 不过当时没空所以没仔细研究 现在找不到了想上来问问 (实际的 code 太复杂了, 以下拿类似的问题当例子) 复制程式 public plugin_init() { register_clcmd("utf8", "cmdUtf8"); } public cmdUtf8(id) { if (read_argc() < 2) return PLUGIN_HANDLED; new szCmd[32]; read_argv(0, szCmd, 31); new szArg[32]; read_argv(1, szArg, 31); if (equal(szCmd, "utf8") && str_to_num(szArg) > 0) { new str1 = "中文"; if (equal(szArg, str1)) { client_print(id, print_chat, "%s is equal to %s", szArg, str1) } else { client_print(id, print_chat, "%s is not equal to %s", szArg, str1) } } return PLUGIN_HANDLED; } 印象中这样的 code, 在命令列里输入: utf8 中文 一定会显示出 中文 is not equal to 中文 的结果, 换成英文就不会有这个问题 apple is equal to apple apple is not equal to pen , 请问有人有解决方法吗 x0
|