taack has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to use pack to create an ISO8583 set of bit flags. But, I'm running into a problem whenever the most significant bit is set. For instance, pack( "B8", "10000000" ) yields "\302 \200" rather than "\200", pack( "B8", "11000000" ) yields "\303 \200" rather than "\300". Is this a bug in the pack routine or am I missing something in the format string?
Any help would be appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with pack error
by BrowserUk (Patriarch) on Mar 20, 2012 at 22:32 UTC | |
by taack (Initiate) on Mar 20, 2012 at 23:32 UTC | |
by BrowserUk (Patriarch) on Mar 20, 2012 at 23:41 UTC | |
by taack (Initiate) on Mar 21, 2012 at 15:47 UTC | |
by BrowserUk (Patriarch) on Mar 21, 2012 at 16:27 UTC | |
|
Re: Help with pack error
by JavaFan (Canon) on Mar 21, 2012 at 07:36 UTC | |
|
Re: Help with pack error
by taack (Initiate) on Mar 21, 2012 at 15:51 UTC |