vendor/bundle/ruby/2.7.0/gems/simpleidn-0.2.1/lib/simpleidn.rb
# Applies UTS46 mapping to a Unicode string
# Returns a UTF-8 string in Normalization Form C (NFC)
Applies UTS46 mapping to a Unicode string
Returns a UTF-8 string in Normalization Form C (NFC)
Applies UTS46 mapping to a Unicode string Returns a UTF - 8 string in Normalization Form C ( NFC )
def uts46map(str, transitional = false)
    mapped = str.codepoints.map { |cp| UTS64MAPPING.fetch(cp, cp) }
    mapped = mapped.map { |cp| TRANSITIONAL.fetch(cp, cp) } if transitional
    mapped = mapped.flatten.map { |cp| cp.chr(Encoding::UTF_8) }.join(EMPTY)
    mapped.to_nfc
  end
def uts46map ( str , transitional = false ) mapped = str . codepoints . map { | cp | UTS64MAPPING . fetch ( cp , cp ) } mapped = mapped . map { | cp | TRANSITIONAL . fetch ( cp , cp ) } if transitional mapped = mapped . flatten . map { | cp | cp . chr ( Encoding :: UTF_8 ) } . join ( EMPTY ) mapped . to_nfc end
Applies UTS46 mapping to a Unicode string
Returns a UTF-8 string in Normalization Form C (NFC)
Applies UTS46 mapping to a Unicode string Returns a UTF - 8 string in Normalization Form C ( NFC )
str
<not_specific>
transitional
<not_specific>