Bug 103520 - printf char N where N>127 produces 2 bytes instead of 1
Summary: printf char N where N>127 produces 2 bytes instead of 1
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: perl (Show other bugs)
(Show other bugs)
Version: 9
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Chip Turner
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-09-01 18:31 UTC by Kirk Turner-Rustin
Modified: 2007-04-18 16:57 UTC (History)
0 users

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


Attachments (Terms of Use)

Description Kirk Turner-Rustin 2003-09-01 18:31:19 UTC
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 13:13:12 UTC
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.