LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Unicode Character Check in Perl (https://www.linuxquestions.org/questions/programming-9/unicode-character-check-in-perl-578639/)

gjagadish 08-21-2007 04:14 AM

Unicode Character Check in Perl
 
Hi,

I have a string in $str.
I need to verify whether that string has unicode characters or not using perl.

How to do that?

thanks in advance
Jagadish

ghostdog74 08-21-2007 11:04 PM

see here for some inspiration

gjagadish 08-21-2007 11:31 PM

Thanks for ur reply

I hv used following regex to check for unicode characters in a string

if ($str =~ /[^[:ascii]]/)
{
print "Unicode character is there in the string"
}

Now it works


All times are GMT -5. The time now is 01:14 AM.