mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (parse_mode_enc): remove warnings 'Ignoring internal encoding'.
[ruby-core:44455] [Bug #6324] * io.c (io_encoding_set): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
66b0d426ed
commit
afd9ce9d9e
3 changed files with 15 additions and 12 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Sat May 5 00:53:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* io.c (parse_mode_enc): remove warnings 'Ignoring internal encoding'.
|
||||||
|
[ruby-core:44455] [Bug #6324]
|
||||||
|
|
||||||
|
* io.c (io_encoding_set): ditto.
|
||||||
|
|
||||||
Fri May 4 07:19:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
Fri May 4 07:19:02 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* lib/rdoc/parser.rb (RDoc.binary?): fix wrong regexp.
|
* lib/rdoc/parser.rb (RDoc.binary?): fix wrong regexp.
|
||||||
|
|
5
io.c
5
io.c
|
@ -4712,7 +4712,6 @@ parse_mode_enc(const char *estr, rb_encoding **enc_p, rb_encoding **enc2_p, int
|
||||||
if (idx2 < 0)
|
if (idx2 < 0)
|
||||||
unsupported_encoding(p);
|
unsupported_encoding(p);
|
||||||
else if (idx2 == idx) {
|
else if (idx2 == idx) {
|
||||||
rb_warn("Ignoring internal encoding %s: it is identical to external encoding %s", p, estr);
|
|
||||||
int_enc = (rb_encoding *)Qnil;
|
int_enc = (rb_encoding *)Qnil;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -8788,8 +8787,6 @@ io_encoding_set(rb_io_t *fptr, VALUE v1, VALUE v2, VALUE opt)
|
||||||
if (enc == enc2) {
|
if (enc == enc2) {
|
||||||
/* Special case - "-" => no transcoding */
|
/* Special case - "-" => no transcoding */
|
||||||
VALUE tmp1 = rb_check_string_type(v1);
|
VALUE tmp1 = rb_check_string_type(v1);
|
||||||
rb_warn("Ignoring internal encoding %s: it is identical to external encoding %s",
|
|
||||||
StringValueCStr(tmp), NIL_P(tmp1) ? rb_enc_name(enc) : StringValueCStr(tmp1));
|
|
||||||
enc2 = NULL;
|
enc2 = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8798,8 +8795,6 @@ io_encoding_set(rb_io_t *fptr, VALUE v1, VALUE v2, VALUE opt)
|
||||||
if (enc == enc2) {
|
if (enc == enc2) {
|
||||||
/* Special case - "-" => no transcoding */
|
/* Special case - "-" => no transcoding */
|
||||||
VALUE tmp1 = rb_check_string_type(v1);
|
VALUE tmp1 = rb_check_string_type(v1);
|
||||||
rb_warn("Ignoring internal encoding %s: it is identical to external encoding %s",
|
|
||||||
rb_enc_name(enc), NIL_P(tmp1) ? rb_enc_name(enc) : StringValueCStr(tmp1));
|
|
||||||
enc2 = NULL;
|
enc2 = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -985,26 +985,27 @@ EOT
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_set_encoding_identical
|
def test_set_encoding_identical
|
||||||
bug5568 = '[ruby-core:40727]'
|
#bug5568 = '[ruby-core:40727]'
|
||||||
|
bug6324 = '[ruby-core:44455]'
|
||||||
open(__FILE__, "r") do |f|
|
open(__FILE__, "r") do |f|
|
||||||
assert_warn(/Ignoring internal encoding euc-jp: it is identical to external encoding eucjp/, bug5568) {
|
assert_warn('', bug6324) {
|
||||||
f.set_encoding("eucjp:euc-jp")
|
f.set_encoding("eucjp:euc-jp")
|
||||||
}
|
}
|
||||||
assert_warn(/Ignoring internal encoding euc-jp: it is identical to external encoding eucjp/, bug5568) {
|
assert_warn('', bug6324) {
|
||||||
f.set_encoding("eucjp", "euc-jp")
|
f.set_encoding("eucjp", "euc-jp")
|
||||||
}
|
}
|
||||||
assert_warn(/Ignoring internal encoding euc-jp: it is identical to external encoding EUC-JP/, bug5568) {
|
assert_warn('', bug6324) {
|
||||||
f.set_encoding(Encoding::EUC_JP, "euc-jp")
|
f.set_encoding(Encoding::EUC_JP, "euc-jp")
|
||||||
}
|
}
|
||||||
assert_warn(/Ignoring internal encoding EUC-JP: it is identical to external encoding eucjp/, bug5568) {
|
assert_warn('', bug6324) {
|
||||||
f.set_encoding("eucjp", Encoding::EUC_JP)
|
f.set_encoding("eucjp", Encoding::EUC_JP)
|
||||||
}
|
}
|
||||||
assert_warn(/Ignoring internal encoding EUC-JP: it is identical to external encoding EUC-JP/, bug5568) {
|
assert_warn('', bug6324) {
|
||||||
f.set_encoding(Encoding::EUC_JP, Encoding::EUC_JP)
|
f.set_encoding(Encoding::EUC_JP, Encoding::EUC_JP)
|
||||||
}
|
}
|
||||||
nonstr = Object.new
|
nonstr = Object.new
|
||||||
def nonstr.to_str; "eucjp"; end
|
def nonstr.to_str; "eucjp"; end
|
||||||
assert_warn(/Ignoring internal encoding eucjp: it is identical to external encoding eucjp/, bug5568) {
|
assert_warn('', bug6324) {
|
||||||
f.set_encoding(nonstr, nonstr)
|
f.set_encoding(nonstr, nonstr)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue