|
Home > Archive > Red Hat Topics > November 2004 > Redhat Enterprise Question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Redhat Enterprise Question
|
|
| Sparky 2004-11-21, 2:45 am |
| I don't really know how to ask this because it works under AIX so here
goes. This is not a PERL related question but about how linux
displays characters via less, more, pg or vi etc.
This PERL program prints an ascii chart, decimal, hex, octal and
(hopefully) the character representation.
#!/usr/bin/perl -w
$ascii_counter = 0;
while ( $ascii_counter < 256 ) {
printf "%3s %2x %3o %1s\n", $ascii_counter, $ascii_counter,
$ascii_counter, chr($ascii_counter);
$ascii_counter++;
}
exit;
My question is, for example, decimal 199, hex c7, octal 307 should
display a character of Ç (cedilla) but if I vi a file (under linux)
that contains this character its not what I'd expect to be displayed.
Under AIX this program works and displays as I would expect as well as
any editor or pager but under linux I see totally different things and
worse when I use the pagers like less or more.
Have I installed something wrong or missed something during
installation?
Next step is a ticket to redhat.
Thanks
| |
| Jean-David Beyer 2004-11-21, 7:45 am |
| Sparky wrote:
> I don't really know how to ask this because it works under AIX so here
> goes. This is not a PERL related question but about how linux displays
> characters via less, more, pg or vi etc.
>
> This PERL program prints an ascii chart, decimal, hex, octal and
> (hopefully) the character representation.
>
> #!/usr/bin/perl -w
>
> $ascii_counter = 0;
>
> while ( $ascii_counter < 256 ) { printf "%3s %2x %3o %1s\n",
> $ascii_counter, $ascii_counter, $ascii_counter, chr($ascii_counter);
> $ascii_counter++; }
>
> exit;
>
> My question is, for example, decimal 199, hex c7, octal 307 should
> display a character of Ç (cedilla) but if I vi a file (under linux)
> that contains this character its not what I'd expect to be displayed.
> Under AIX this program works and displays as I would expect as well as
> any editor or pager but under linux I see totally different things and
> worse when I use the pagers like less or more.
>
> Have I installed something wrong or missed something during
> installation?
>
> Next step is a ticket to redhat.
>
I just tried it on RHEL 3 and it displays the _printable ASCII_ characters
OK, and little grey box outlines for the rest.
--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ Registered Machine 241939.
/( )\ Shrewsbury, New Jersey http://counter.li.org
^^-^^ 07:45:00 up 29 days, 10:39, 3 users, load average: 4.23, 4.29, 4.23
| |
| Markku Kolkka 2004-11-21, 5:45 pm |
| Sparky wrote:
> This PERL program prints an ascii chart, decimal, hex, octal and
> (hopefully) the character representation.
>
> #!/usr/bin/perl -w
>
> $ascii_counter = 0;
>
> while ( $ascii_counter < 256 ) {
_ASCII_ only has character codes 0-127. The handling of character codes
128 and beyond depends on the character set and encoding used by the
system.
> printf "%3s %2x %3o %1s\n", $ascii_counter, $ascii_counter,
> $ascii_counter, chr($ascii_counter);
> $ascii_counter++;
> }
>
> exit;
>
> My question is, for example, decimal 199, hex c7, octal 307 should
> display a character of Ç (cedilla)
Only if you are using one of the ISO Latin character sets (ISO 8859-1,
etc). I think RHEL uses UTF-8 encoded Unicode like RHL9 and Fedora do.
--
Markku Kolkka
markku.kolkka@iki.fi
| |
| Sparky 2004-11-22, 5:45 pm |
| On Sat, 20 Nov 2004 23:32:21 -0500, Sparky <tyates@newsguy.com> wrote:
>I don't really know how to ask this because it works under AIX so here
>goes. This is not a PERL related question but about how linux
>displays characters via less, more, pg or vi etc.
>
>This PERL program prints an ascii chart, decimal, hex, octal and
>(hopefully) the character representation.
>
>#!/usr/bin/perl -w
>
>$ascii_counter = 0;
>
>while ( $ascii_counter < 256 ) {
> printf "%3s %2x %3o %1s\n", $ascii_counter, $ascii_counter,
>$ascii_counter, chr($ascii_counter);
> $ascii_counter++;
>}
>
>exit;
>
>My question is, for example, decimal 199, hex c7, octal 307 should
>display a character of Ç (cedilla) but if I vi a file (under linux)
>that contains this character its not what I'd expect to be displayed.
>Under AIX this program works and displays as I would expect as well as
>any editor or pager but under linux I see totally different things and
>worse when I use the pagers like less or more.
>
>Have I installed something wrong or missed something during
>installation?
>
>Next step is a ticket to redhat.
>
>Thanks
We found the issue. Its because redhat choose to use utf-8 code set.
If I want to change this how would I permanently set the OS to a code
page of 819 and a code set of ISO8859-1? Is it simply a change to
/etc/sysconfig/i18n?
Thanks
|
|
|
|
|