uses UnicodeData;
function IsCharWord(ch: WideChar): boolean;
var
NType: byte;
begin
case ch of
'0'..'9',
'a'..'z',
'A'..'Z',
'_':
exit(true);
end;
if Ord(ch)<128 then
Result:= false
else
if Ord(ch)>=LOW_SURROGATE_BEGIN then
exit(false)
else
begin
NType:= GetProps(Ord(ch))^.Category;
Result:= (NType<=UGC_OtherNumber);
end;
end;