mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fixed that iconv decoding should catch InvalidEncoding #3153 [jon@siliconcircus.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4901 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
9db407f578
commit
bf2bddd29f
1 changed files with 1 additions and 1 deletions
|
@ -80,7 +80,7 @@ module TMail
|
|||
def convert_to(text, to, from)
|
||||
return text unless to && from
|
||||
text ? Iconv.iconv(to, from, text).first : ""
|
||||
rescue Iconv::IllegalSequence, Errno::EINVAL
|
||||
rescue Iconv::IllegalSequence, Iconv::InvalidEncoding, Errno::EINVAL
|
||||
# the 'from' parameter specifies a charset other than what the text
|
||||
# actually is...not much we can do in this case but just return the
|
||||
# unconverted text.
|
||||
|
|
Loading…
Reference in a new issue