Method: DomainName::Punycode.decode_hostname

Defined in:
lib/domain_name/punycode.rb

.decode_hostname(hostname) ⇒ Object

Decode a hostname using IDN/Punycode algorithms



276
277
278
279
280
# File 'lib/domain_name/punycode.rb', line 276

def decode_hostname(hostname)
  hostname.gsub(/(\A|#{Regexp.quote(DOT)})#{Regexp.quote(PREFIX)}([^#{Regexp.quote(DOT)}]*)/o) {
    $1 << decode($2)
  }
end