mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
merges r21047 from trunk into ruby_1_9_1.
* transcode.c (str_transcode0): set encoding when String#encode was given explicit but the same destination and source encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1f161c1824
commit
b7a1cb6251
3 changed files with 8 additions and 2 deletions
|
@ -2455,7 +2455,7 @@ str_transcode0(int argc, VALUE *argv, VALUE *self, int ecflags, VALUE ecopts)
|
|||
ECONV_XML_ATTR_CONTENT_DECORATOR|
|
||||
ECONV_XML_ATTR_QUOTE_DECORATOR)) == 0) {
|
||||
if (senc && senc == denc) {
|
||||
return -1;
|
||||
return NIL_P(arg2) ? -1 : dencidx;
|
||||
}
|
||||
if (senc && denc && rb_enc_asciicompat(senc) && rb_enc_asciicompat(denc)) {
|
||||
if (ENC_CODERANGE(str) == ENC_CODERANGE_7BIT) {
|
||||
|
@ -2463,7 +2463,7 @@ str_transcode0(int argc, VALUE *argv, VALUE *self, int ecflags, VALUE ecopts)
|
|||
}
|
||||
}
|
||||
if (encoding_equal(sname, dname)) {
|
||||
return -1;
|
||||
return NIL_P(arg2) ? -1 : dencidx;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue