Using ChatFrame_AddMessageEventFilter might work for filtering chinese/japanese/korean/asian characters
I wrote a test script for this, and did some quick testing against myself (I'm Chinese so that's even better, lol)
what it does: the filter func checks the first control character of the ASCII code, and filters it if it starts in the 228 to 233 range
Code:
local events = {
"CHAT_MSG_SAY",
"CHAT_MSG_YELL",
"CHAT_MSG_CHANNEL",
}
local function filter(self, event, msg, ...)
if strfind(msg, "[\228-\233]") then
return true
end
end
for _, v in ipairs(events) do
ChatFrame_AddMessageEventFilter(v, filter)
end
-- [HowTo] Make a code snippet into an addon in twelve easy steps
and in macro form if you want to test it out ingame:
/run for _,v in ipairs({"CHAT_MSG_SAY","CHAT_MSG_YELL","CHAT_MSG_CHANNEL"})do ChatFrame_AddMessageEventFilter(v,function(_,_,msg)if strfind(msg,"[\228-\233]")then return true end end)end
asian character examples
"あ" = "\227\129\130"
"が" = "\227\129\140"
"の" = "\227\129\174"
"私" = "\231\167\129"
"一" = "\228\184\128"
"国" = "\229\155\189"
"家" = "\229\174\182"
"我" = "\230\136\145"
"爱" = "\231\136\177"
"要" = "\232\166\129"
"體" = "\233\171\148"
"국" = "\234\181\173"
"말" = "\235\167\144"
"어" = "\236\150\180"
"한" = "\237\149\156"
- afaik Japanese katakana / hiragana are on 227
- Chinese characters and Japanese kanji are around the 228 - 233 range
- and Korean characters are around the 234 - 237 range