From: Tanaka Akira Date: 2008-09-16T13:31:31+09:00 Subject: [ruby-dev:36320] Re: 合成文字の2コードポイント目 In article , Yukihiro Matsumoto writes: > 実際にはrb_enc_codepoint()とrb_enc_codelen()の組み合わせにし > てさきほどコミットしました。 あぁ、それなら動きますね。 > |rb_enc_codepoint でなく、rb_enc_mbc_precious_codepoint を使っ > |て、長さを得る必要があります。valid でないものを途中で見つけ > |たら例外ですかね。 > > えーと、この辺の関数名の働きがよく分かってないんですが、 > rb_enc_codepoint()はもう使えないんですか。この場合、 > rb_enc_codepoint()とrb_enc_mbc_precious_codepoint()との違いは > なんなんでしょう? (precious → precise?) rb_enc_codepoint は使えます。 rb_enc_mbc_precious_codepoint はコードポイントを扱うときのプ リミティブです。コードポイントと、コードポイントに対する rb_enc_precise_mbclen というようなものの結果を返します。 rb_enc_codepoint は内部で rb_enc_precise_mbclen を使っていま すが、扱っているのは文字じゃなくてコードポイントなので、 rb_enc_mbc_precious_codepoint を使うべきですね。 precious -> precise は、そうあるべきです。そうします。 あとで入れておきます。 -- [田中 哲][たなか あきら][Tanaka Akira]