LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

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

Rep: Reputation: 15
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
 
Old 08-22-2007, 12:04 AM   #2
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 241Reputation: 241Reputation: 241
see here for some inspiration
 
Old 08-22-2007, 12:31 AM   #3
gjagadish
Member
 
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
 
  


Reply


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 05:26 AM
unicode & frensh character ! ik@z Linux - General 1 05-17-2006 01:07 AM
perl post character escaping kapilcool Programming 3 12-20-2005 08:42 AM
Check to see if a file has a certain character in it krock923 Programming 2 11-25-2004 04:30 PM
perl mysql DBI 400 character limit? tjtoocool Linux - Software 2 01-10-2004 05:44 AM


All times are GMT -5. The time now is 11:28 PM.

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