[#37248] [Feature:1.9] Enumerator#inspect — "Yusuke ENDOH" <mame@...>

遠藤です。

12 messages 2008/12/02

[#37337] [Feature #841] Object#self — "rubikitch ." <redmine@...>

Feature #841: Object#self

13 messages 2008/12/09

[#37513] Current status of 1.9.1 RC1's issues — "Yugui (Yuki Sonoda)" <yugui@...>

Hi, folks

14 messages 2008/12/20
[#37516] Re: Current status of 1.9.1 RC1's issues — Masatoshi SEKI <m_seki@...> 2008/12/20

咳といいます。

[#37576] [BUG:trunk] encoding for stdio's — "Yugui (Yuki Sonoda)" <yugui@...>

Yuguiです。

11 messages 2008/12/24

[ruby-dev:37309] Re: pack format 'H' when the packee has insufficient and odd digits

From: Yukihiro Matsumoto <matz@...>
Date: 2008-12-08 08:48:14 UTC
List: ruby-dev #37309
まつもと ゆきひろです

In message "Re: [ruby-dev:37283] pack format 'H' when the packee has insufficient and odd digits"
    on Fri, 5 Dec 2008 20:32:51 +0900, "Yugui (Yuki Sonoda)" <yugui@yugui.jp> writes:

|pack format 'H'において、被パックデータが16進で奇数桁である場合、生成さ
|れるバイト列の長さに「ジャンプ」が見られます。

|H4の場合は足りない第4ニブルを0と見なして、2バイト目の下位ニブルに充てる
|のが自然な気がします。

|現状の振るまいは意図されたものでしょうか?

意図したものではないです。ここはPerlに合わせるべきだと思いま
す。ちなみに今調べたところではPerlでの結果の長さは

# perl -le 'print length(pack("H1", "FFF"))'
1
# perl -le 'print length(pack("H2", "FFF"))'
1

以下、H3=>2, H4=>2, H5=>3, H6=>3, H7=>4, H8=>4, H9=>5 と続き
ます。

                                まつもと ゆきひろ /:|)

In This Thread

Prev Next