in reply to Re: em and en dash problem
in thread em and en dash problem

hi, I have tried the same but i am not able to enter the char en and en dash. If i am trying to enter those chars it's displaying as dot. And the code which i have tried is:
use charnames ':full'; /\N{EM DASH}/; use utf8; $a="."; if($a =~/\x{2014}/) { print "Found"; } else { print "Not Found"; }
Thanks

Replies are listed 'Best First'.
Re^3: em and en dash problem
by choroba (Cardinal) on Oct 26, 2010 at 07:59 UTC
    Are you using a utf-8-capable editor? Is the editor using a utf-8-capable font?
      hi, I don't know. But i am using normal vi editor of Linux Os. How to check weather a editor is utf-8 char or not. Thanks

        Current Linux distributions are UTF-8 capable, and Vim is likewise. That's not the end of the story, however. You also need to make sure you're using a font that has definitions for the glyphs you are going to use. My suggestion is to visit the UTF-8 FAQ and then you'll have a much better background in character encoding.

Re^3: em and en dash problem
by ikegami (Patriarch) on Oct 26, 2010 at 13:55 UTC
    You can use \x and \N in double-quoted literals too, if you donj't want to struggle with your editor.