class ICU::IDNA
- ICU::IDNA
- Reference
- Object
Overview
International Domain Names in Applications
Implements UTS #46 and IDNA2008.
Usage
dn = ICU::IDNA.to_ascii("افغانستا.icom.museum") # => "xn--mgbaal8b0b9b2b.icom.museum"
ICU::IDNA.to_unicode(dn) # => "افغانستا.icom.museum"
ICU::IDNA.compare("افغانستا.icom.museum", "xn--mgbaal8b0b9b2b.icom.museum") # => 0
See also
Defined in:
icu/idna.crClass Method Summary
-
.compare(idn1 : String, idn2 : String, options : UInt32 = Option::Default.to_u32) : Int
Compares two IDN strings (that can be in unicode or ascii representation)
-
.to_ascii(unicode_idn : String, options : UInt32 = Option::Default.to_u32) : String
Converts a Unicode IDN to it's ASCII representation
-
.to_unicode(ascii_idn : String, options : UInt32 = Option::Default.to_u32) : String
Converts an ASCII IDN to it's Unicode representation
Class Method Detail
Compares two IDN strings (that can be in unicode or ascii representation)
ICU::IDNA.compare("افغانستا.icom.museum", "xn--mgbaal8b0b9b2b.icom.museum") # => 0
(see String#compare
)
Converts a Unicode IDN to it's ASCII representation
ICU::IDNA.to_ascii("افغانستا.icom.museum") # => "xn--mgbaal8b0b9b2b.icom.museum"
Converts an ASCII IDN to it's Unicode representation
ICU::IDNA.to_unicode("xn--mgbaal8b0b9b2b.icom.museum") # => "افغانستا.icom.museum"