2017-07-18 3:53 GMT+02:00 Thierry Douez <th.do...@gmail.com>:

>
>> I want to know if this data contains Chinese characters
>>
>> Thanks for suggestions!
>>
>> Peter Bogdanoff
>>
>>
> ​Hi Peter,
>


​Ok, back after my second morning coffee :)

A better way to check for Chinese code points would be
something like that (not tested and never used myself) :


function testForChinese utf8Text
   return matchText( utf8Text, "\p{Han}")
end testForChinese

Of course, it won't work with  htmlText, but straight with
the text of a field, assuming it's coded in UTF8 !!!


HTH,

Thierry
​

> ​
> ​Mmm, not sure you'll get *only* Chinese characters,
> but at least any entity with only 5 numbers.
>
> This function returns true if find any, false otherwise:
> ​
> function testForChinese T
> ​xt​
> ​ -- any htmltext​
>    return matchText(
> ​Txt
> , "&#\d{5};")
> end testForChinese
>
> ​Regards,
>
> Thierry​
>


-- 
------------------------------------------------
Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to