引用 | 編輯
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
|