How to display 192 character symbol ( └ ) in perl ?
相关问题
- $ENV{$variable} in perl
- Is it possible to pass command-line arguments to @
- Redirecting STDOUT and STDERR to a file, except fo
- Change first key of multi-dimensional Hash in perl
- How do I get a filehandle from the command line?
相关文章
- Running a perl script on windows without extension
- Comparing speed of non-matching regexp
- Can NOT List directory including space using Perl
- Extracting columns from text file using Perl one-l
- Lazy (ungreedy) matching multiple groups using reg
- How do I tell DBD::mysql where mysql.sock is?
- What is a good way to deploy a Perl application?
- Speeding up Selenium Webdriver
What you want is to be able to print unicode, and the answer is in
perldoc perluniintro
.You can use
\x{nnnn}
where n is the hex identifier, or you can do\N{...}
with the name:That looks like the Code page 437 encoding. Perl is probably just outputting bytes that you give it. And your terminal is probably expecting UTF8.
So you need to decode it to Unicode, then re-encode it in UTF-8.
EDIT: Correct encoding.
As usual, Jon Skeet nails it: the
192
code is in the "extended ASCII" range. I suggest you follow @Douglas Leeder's advice, but I'm not sure which encoding www.LookupTables.com is giving you;ISO-8859-1
thinks 192 maps to "À", andMac OS Roman
thinks its "¿".To use exactly these codes your terminal must support Code Page 437, which contains frames. Alternatively you can use derived CP850 with less boxing characters. Such boxing characters also exist as Unicode Block Elements. The char which you want in perl is noted as
\N{U+2514}
. More details in perlunicode