M
Michael Krueger
Hi,
I have a text based application and want to draw some kind of frame, on
the screen. OS is Debian/Linux using Perl 5.6
I'm using this code:
-- snip ---
my $top = chr(201);
my $bottom = chr(200);
for (my $i = 0; $i < ($termCols-2); $i++)
{
$top .= chr(205);
$bottom .= chr(205);
}
$top .= chr(187);
$bottom .= chr(188);
$term->Tgoto('cm', 0, 0, *STDOUT);
print $top;
for (my $i = 1; $i < ($termRows-1); $i++)
{
$term->Tgoto('cm', 0, $i, *STDOUT);
print chr(186);
$term->Tgoto('cm', $termCols-1, $i, *STDOUT);
print chr(186);
}
$term->Tgoto('cm', 0, $termRows-2, *STDOUT);
print $bottom;
-- snip --
Where $termCols and $termRows are the current terminal lines and columns.
Problem:
Due to the encoding to latin-1 charset I didn't get the expected
frame-symbols but some other accentuated(?) chars.
How can I change the encoding that I can use the extended ASCII set, which
is referred often as the most common e.g. on www.asciitable.com, which
contains these frame-symbols?
I'm aware of 'use encoding "..";' but I just can't find the correct table.
michael
I have a text based application and want to draw some kind of frame, on
the screen. OS is Debian/Linux using Perl 5.6
I'm using this code:
-- snip ---
my $top = chr(201);
my $bottom = chr(200);
for (my $i = 0; $i < ($termCols-2); $i++)
{
$top .= chr(205);
$bottom .= chr(205);
}
$top .= chr(187);
$bottom .= chr(188);
$term->Tgoto('cm', 0, 0, *STDOUT);
print $top;
for (my $i = 1; $i < ($termRows-1); $i++)
{
$term->Tgoto('cm', 0, $i, *STDOUT);
print chr(186);
$term->Tgoto('cm', $termCols-1, $i, *STDOUT);
print chr(186);
}
$term->Tgoto('cm', 0, $termRows-2, *STDOUT);
print $bottom;
-- snip --
Where $termCols and $termRows are the current terminal lines and columns.
Problem:
Due to the encoding to latin-1 charset I didn't get the expected
frame-symbols but some other accentuated(?) chars.
How can I change the encoding that I can use the extended ASCII set, which
is referred often as the most common e.g. on www.asciitable.com, which
contains these frame-symbols?
I'm aware of 'use encoding "..";' but I just can't find the correct table.
michael