1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use unpack1 instead of unpack and [0]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2018-09-03 13:52:09 +00:00
parent c115b39e03
commit aa5d99280d

View file

@ -999,7 +999,7 @@ module Net
def self.decode_utf7(s)
return s.gsub(/&([^-]+)?-/n) {
if $1
($1.tr(",", "/") + "===").unpack("m")[0].encode(Encoding::UTF_8, Encoding::UTF_16BE)
($1.tr(",", "/") + "===").unpack1("m").encode(Encoding::UTF_8, Encoding::UTF_16BE)
else
"&"
end