Data.Text.IDN.IDNA

gnuidn-0.2.2: Bindings for GNU IDN

Safe Haskell | None
Language | Haskell98

Data.Text.IDN.IDNA

Synopsis

- data Flags = Flags {
  - verifySTD3 :: Bool
  - allowUnassigned :: Bool
  }
- data Error
- defaultFlags :: Flags
- toASCII :: Flags -> Text -> Either Error ByteString
- toUnicode :: Flags -> ByteString -> Text

# Documentation

data Flags #

Constructors

Flags |
Fields verifySTD3 :: Bool Check output to make sure it is a STD3-conforming host name allowUnassigned :: Bool Allow unassigned Unicode code points

Instances

Eq Flags # |
Methods (==) :: Flags -> Flags -> Bool # (/=) :: Flags -> Flags -> Bool #
Show Flags # |
Methods showsPrec :: Int -> Flags -> ShowS # show :: Flags -> String # showList :: [Flags] -> ShowS #

data Error #

Instances

Eq Error # |
Methods (==) :: Error -> Error -> Bool # (/=) :: Error -> Error -> Bool #
Show Error # |
Methods showsPrec :: Int -> Error -> ShowS # show :: Error -> String # showList :: [Error] -> ShowS #

defaultFlags :: Flags #

    defaultFlags = Flags True False

toASCII :: Flags -> Text -> Either Error ByteString #

toUnicode :: Flags -> ByteString -> Text #

Convert a possibly ACE-encoded domain name to Unicode. The domain name may contain several labels, separated by dots.

Aside from memory allocation failure, `toUnicode` always succeeds. If the input cannot be decoded, it is returned unchanged.