Array#pack problem on OS X

Hi,
Could someone verify the incorrect values for Array#pack(‘S’) and
Array#pack(‘n’) I’m getting on my OS X? See below, and thanks!

Barry

···

On Win98:

C:\WINDOWS>ruby -v
ruby 1.6.7 (2002-03-01) [i586-mswin32]

irb(main):001:0> [65].pack(‘S’)
“A\000"
irb(main):002:0> [65].pack(‘v’)
“A\000"
irb(main):003:0> [65].pack(‘n’)
”\000A”

On OS X:

bash-2.05a$ ruby -v
ruby 1.6.7 (2002-03-01) [powerpc-darwin6.0]

irb(main):001:0> [65].pack(‘S’)
"\000A"
irb(main):002:0> [65].pack(‘v’)
"\000A"
irb(main):003:0> [65].pack(‘n’)
"\000A"


MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus

Hi,

···

At Sat, 28 Jun 2003 18:33:48 +0900, Barry Shultz wrote:

ruby 1.6.7 (2002-03-01) [powerpc-darwin6.0]
irb(main):002:0> [65].pack(‘v’)
“\000A”

It’s obviously strange. Is there a line contains
WORD_BIGENDIAN in config.h?


Nobu Nakada

I get the following using Ruby 1.8 preview 3

irb(main):001:0> [65].pack(‘S’)
=> “\000A”
irb(main):002:0> [65].pack(‘v’)
=> “A\000”
irb(main):003:0> [65].pack(‘n’)
=> “\000A”

Regards,

Mark Wilson

···

On Saturday, June 28, 2003, at 05:33 AM, Barry Shultz wrote:

Hi,
Could someone verify the incorrect values for Array#pack(‘S’) and
Array#pack(‘n’) I’m getting on my OS X? See below, and thanks!

[snip]