LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-21-2007, 04:14 AM   #1
Registered: Oct 2005
Location: India
Distribution: Fedora Core
Posts: 88

Rep: Reputation: 15
Unicode Character Check in Perl


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
Old 08-21-2007, 11:04 PM   #2
Senior Member
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 242Reputation: 242Reputation: 242
see here for some inspiration
Old 08-21-2007, 11:31 PM   #3
Registered: Oct 2005
Location: India
Distribution: Fedora Core
Posts: 88

Original Poster
Rep: Reputation: 15
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl: replace character in file vippie Programming 4 03-23-2007 04:26 AM
unicode & frensh character ! ik@z Linux - General 1 05-17-2006 12:07 AM
perl post character escaping kapilcool Programming 3 12-20-2005 07:42 AM
Check to see if a file has a certain character in it krock923 Programming 2 11-25-2004 03:30 PM
perl mysql DBI 400 character limit? tjtoocool Linux - Software 2 01-10-2004 04:44 AM

All times are GMT -5. The time now is 04:43 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration