diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-20 04:20:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-20 04:20:53 +0000 |
commit | 7992fabaf40f8635653d267592f591d9cc4c511e (patch) | |
tree | fd906fc8dd233306c3b07515726ee374eb35881d /ext/nkf/nkf.c | |
parent | 75aa81b79d078ba7d02e097cf53e629d851d874c (diff) | |
download | ruby-7992fabaf40f8635653d267592f591d9cc4c511e.tar.gz |
* ext/nkf/nkf.c (rb_nkf_convert), ext/nkf/nkf-utf8/nkf.c
(nkf_enc_without_bom): BOM is not a part of encodings.
* ext/nkf/nkf.c (Init_nkf), ext/nkf/nkf-utf8/nkf.c (options):
UTF-{16,32} without endian have no sense.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf/nkf.c')
-rw-r--r-- | ext/nkf/nkf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c index c11a042c57..eb7d76af14 100644 --- a/ext/nkf/nkf.c +++ b/ext/nkf/nkf.c @@ -160,7 +160,7 @@ rb_nkf_convert(VALUE obj, VALUE opt, VALUE src) rb_str_set_len(result, output_ctr); OBJ_INFECT(result, src); - rb_enc_associate(result, rb_nkf_enc_get(nkf_enc_name(output_encoding))); + rb_enc_associate(result, rb_nkf_enc_get(nkf_enc_name(nkf_enc_without_bom(output_encoding)))); return result; } @@ -480,8 +480,8 @@ Init_nkf() rb_define_const(mNKF, "EUC", rb_enc_from_encoding(rb_nkf_enc_get("EUC-JP"))); rb_define_const(mNKF, "SJIS", rb_enc_from_encoding(rb_nkf_enc_get("Shift_JIS"))); rb_define_const(mNKF, "UTF8", rb_enc_from_encoding(rb_utf8_encoding())); - rb_define_const(mNKF, "UTF16", rb_enc_from_encoding(rb_nkf_enc_get("UTF-16"))); - rb_define_const(mNKF, "UTF32", rb_enc_from_encoding(rb_nkf_enc_get("UTF-32"))); + rb_define_const(mNKF, "UTF16", rb_enc_from_encoding(rb_nkf_enc_get("UTF-16BE"))); + rb_define_const(mNKF, "UTF32", rb_enc_from_encoding(rb_nkf_enc_get("UTF-32BE"))); /* Full version string of nkf */ rb_define_const(mNKF, "VERSION", rb_str_new2(RUBY_NKF_VERSION)); |