lib/addressable/idna/pure.rb in addressable-2.3.8 vs lib/addressable/idna/pure.rb in addressable-2.4.0
- old
+ new
@@ -91,11 +91,11 @@
# domain name as described in RFC 3490.
def self.to_unicode(input)
input = input.to_s unless input.is_a?(String)
parts = input.split('.')
parts.map! do |part|
- if part =~ /^#{ACE_PREFIX}/
+ if part =~ /^#{ACE_PREFIX}(.+)/
punycode_decode(part[/^#{ACE_PREFIX}(.+)/, 1])
else
part
end
end
@@ -173,11 +173,10 @@
return ch_one + (ch_two - HANGUL_TBASE)
end
p = []
ucs4_to_utf8 = lambda do |ch|
- # For some reason, rcov likes to drop BUS errors here.
if ch < 128
p << ch
elsif ch < 2048
p << (ch >> 6 | 192)
p << (ch & 63 | 128)
@@ -486,10 +485,10 @@
outlen = out
outlen.times do |j|
c = output[j]
unless c >= 0 && c <= 127
- raise Exception, "Invalid output char."
+ raise StandardError, "Invalid output char."
end
unless PUNYCODE_PRINT_ASCII[c]
raise PunycodeBadInput, "Input is invalid."
end
end