Bug 103520 - printf char N where N>127 produces 2 bytes instead of 1
printf char N where N>127 produces 2 bytes instead of 1
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: perl (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Chip Turner
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-09-01 14:31 EDT by Kirk Turner-Rustin
Modified: 2007-04-18 12:57 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-09-02 09:13:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kirk Turner-Rustin 2003-09-01 14:31:19 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Description of problem:
Under RedHat 9, when I use Perl to print a character whose ASCII decimal
equivalent is greater than 127, I get two bytes instead of one. This difference
does not appear in Perl distributions that came with RedHat Linux 6.2, 7.2, 7.3.
(I don't have a RH 8.x box to test.)

Version-Release number of selected component (if applicable):
perl-5.8.0-88

How reproducible:
Always

Steps to Reproduce:
perl -e 'printf("%c", 169);' | od -ab

Actual Results:
0000000   B   )
        302 251
0000003

Any ASCII decimal between 128 and 255 produces similar results (two bytes
instead of one).

Expected Results:
0000000   )
        251
0000002

Additional info:

The following simple C program produces the expected results on the same platform:

% cat test.c
#include <stdio.h>
main() { printf("%c", 169); }

% cc test.c
% ./a.out | od -ab
0000000   )
        251
0000002
% _
Comment 1 Chip Turner 2003-09-02 09:13:12 EDT
this is fixed in the perl in rawhide

Note You need to log in before you can comment on or make changes to this bug.