module Net::IMAP::StringPrep::NamePrep

Defined in RFC3491, the nameprep profile of “Stringprep” is:

used by the IDNA protocol for preparing domain names; it is not designed for any other purpose. It is explicitly not designed for processing arbitrary free text and SHOULD NOT be used for that purpose.

This profile specifies prohibiting using the following tables…:

  • C.1.2 (Non-ASCII space characters)

  • C.2.2 (Non-ASCII control characters)

  • C.3 (Private use characters)

  • C.4 (Non-character code points)

  • C.5 (Surrogate codes)

  • C.6 (Inappropriate for plain text)

  • C.7 (Inappropriate for canonical representation)

  • C.8 (Change display properties are deprecated)

  • C.9 (Tagging characters)

IMPORTANT NOTE: This profile MUST be used with the IDNA protocol. The IDNA protocol has additional prohibitions that are checked outside of this profile.

Constants

CHECK_BIDI

From RFC3491 §6

MAPPING_TABLES

From RFC3491 §3

NORMALIZATION

From RFC3491 §4

PROHIBITED_TABLES

From RFC3491 §5

STRINGPREP_PROFILE

From RFC3491 §10

UNASSIGNED_TABLE

From RFC3491 §2

Public Instance Methods

nameprep(string, **opts) click to toggle source
# File lib/net/imap/stringprep/nameprep.rb, line 54
def nameprep(string, **opts)
  StringPrep.stringprep(
    string,
    unassigned:    UNASSIGNED_TABLE,
    maps:          MAPPING_TABLES,
    prohibited:    PROHIBITED_TABLES,
    normalization: NORMALIZATION,
    bidi:          CHECK_BIDI,
    profile:       STRINGPREP_PROFILE,
    **opts,
  )
end