Loading ...
Sorry, an error occurred while loading the content.
 

How to print a "non-ascii" character inside a Perl Script

Expand Messages
  • Rahul Jain
    Hi all, How to print non ascii characters in a perl script ? For ex. I want to print the copyright symbol ( a c inside a circle) as the output of a perl
    Message 1 of 2 , Feb 17, 2001
      Hi all,
      How to print non ascii characters in a perl script ?
      For ex. I want to print the "copyright" symbol ( a 'c' inside a circle)
      as the output of a perl programme.
      Is there any way I can do that?
      TIA,
      Rahul
       
    • Greg Webster
      If you are outputting to HTML (ie. a web browser), then use a list like: http://www.htmlcompendium.org/7entity.htm The code for copyright is © However, if
      Message 2 of 2 , Feb 18, 2001
        If you are outputting to HTML (ie. a web browser), then use a list like:
        http://www.htmlcompendium.org/7entity.htm

        The code for copyright is ©

        However, if you are using it in another context, you are dependent on the ascii table your machine is using (and therefore your code may not be portable to another machine, or even in some case, another user). Check into the chr() function.

        On my system chr(169) prints the copyright symbol to the screen, others it may be different.

        Greg

        --
        < >-< >< >-< >< >-< >< >-< >< >-< >< >-< >< >-< >< >-< >< >
        | | | GREG WEBSTER - greg@... | | | |
        <_>-<_><_>-<_><_>-<_><_>-<_><_>-<_><_>-<_><_>-<_><_>-<_><_>
      Your message has been successfully submitted and would be delivered to recipients shortly.