Re: [9fans] xd bug
  Home FAQ Contact Sign in
comp.os.plan9 only
 
Advanced search
POPULAR GROUPS

more...

comp.os.plan9 Profile…
 Up
Re: [9fans] xd bug         


Author: Pietro Gagliardi
Date: Jul 14, 2008 10:05

If you look more closely at the alignment of the characters to the hex
values you will see that xd thinks Q has character code 0x525 and R
has character code 3. It should look more like

%% xd -c -x bad
0000000 e0Q R S \n
0 e0515253 0a000000
0000005

On Jul 14, 2008, at 12:43 PM, Russ Cox wrote:
>> Hello. Regarding my previous question, the file /n/sources/contrib/
>> pietro/xd.out shows a bug in xd regarding characters that can't be
>> printed with the %%c format. There should be no space between...
Show full article (1.64Kb)
3 Comments
Re: [9fans] xd bug         


Author: erik quanstrom
Date: Jul 14, 2008 10:22

> If you look more closely at the alignment of the characters to the hex
> values you will see that xd thinks Q has character code 0x525 and R
> has character code 3. It should look more like
>
> %% xd -c -x bad
> 0000000 e0Q R S \n
> 0 e0515253 0a000000
> 0000005

-x by itself doesn't output the hex codes
for bytes, it outputs the hex codes for 4 byte
integers. i think you're thinking of this command
line instead

; xd -c -1x bad
0000000 e0 Q R S \n
0 e0 51 52 53 0a

- erik
1 Comment
Re: [9fans] xd bug         


Author: Russ Cox
Date: Jul 14, 2008 10:28

> If you look more closely at the alignment of the characters to the hex
> values you will see that xd thinks Q has character code 0x525 and R
> has character code 3. It should look more like
>
> %% xd -c -x bad
> 0000000 e0Q R S \n
> 0 e0515253 0a000000
> 0000005

The -c and -x formats are not intended to align.
If you want hex codes aligned with characters, use -b.

%% echo ABCD | xd -c -x
0000000 A B C D \n
0 41424344 0a000000
0000005
%%

Russ
no comments
Re: [9fans] xd bug         


Author: Pietro Gagliardi
Date: Jul 14, 2008 15:03

On Jul 14, 2008, at 1:13 PM, erik quanstrom wrote:
> -x by itself doesn't output the hex codes
> for bytes, it outputs the hex codes for 4 byte
> integers. i think you're thinking of this command
> line instead
>
> ; xd -c -1x bad
> 0000000 e0 Q R S \n
> 0 e0 51 52 53 0a

On Jul 14, 2008, at 1:22 PM, Russ Cox wrote:
> The -c and -x formats are not intended to align.
> If you want hex codes aligned with characters, use -b.

Thanks for the clarifications. -b == -1x, so both solve this
misunderstanding.
no comments

RELATED THREADS
SubjectArticles qty Group
Re: [BUGS] BUG #2685: Wrong charset of server messages on clientmailing.database.pgsql-bugs ·
Bug#404011: Bug#404012: I'm not planning to change z80asm, please let me know if I misunderstood youlinux.debian.bugs.dist ·
Bug#266625: Very old bug, do you still have the problem ?linux.debian.bugs.dist ·
Bug#397179: [php-maint] Bug#397179: Bug#397179: Bug#397179: Bug#397179: Please don't add this patchlinux.debian.bugs.dist ·