12345678910111213141516171819 |
- class EmailHelper::Idn
- def self.to_ascii(address)
- if address =~ %r{@([^>\s]+)}
- address.sub!($1, SimpleIDN.to_ascii($1))
- end
- address
- end
- def self.to_unicode(address)
- if address =~ %r{@([\w.-]+)}
- address.sub!($1, SimpleIDN.to_unicode($1))
- end
- address
- end
- end
|