punycode-2.0: Encode unicode strings to ascii forms according to RFC 3492

Safe Haskell | None
Language | Haskell98

Data.Text.Punycode

Synopsis

- encode :: Text -> ByteString
- data PunycodeDecodeException
  - = GenericDecodeException
  - | InternalStringTooShort
  - | InputTooShort
  - | RightOfHyphenShouldBeAlphanumeric
  - | LeftOfHyphenShouldBeBasic
  - | CantStartWithDash
  - | InvalidCodePoint
- decode :: ByteString -> Either PunycodeDecodeException Text

# Documentation

encode :: Text -> ByteString #

Encode a string into its ascii form

data PunycodeDecodeException #

Constructors

GenericDecodeException |
InternalStringTooShort |
InputTooShort |
RightOfHyphenShouldBeAlphanumeric |
LeftOfHyphenShouldBeBasic |
CantStartWithDash |
InvalidCodePoint |

#### Instances

Instances details

Eq PunycodeDecodeException # |
Instance details Defined in Data.Text.Punycode.Decode Methods (==) :: PunycodeDecodeException -> PunycodeDecodeException -> Bool # (/=) :: PunycodeDecodeException -> PunycodeDecodeException -> Bool #
Show PunycodeDecodeException # |
Instance details Defined in Data.Text.Punycode.Decode Methods showsPrec :: Int -> PunycodeDecodeException -> ShowS # show :: PunycodeDecodeException -> String # showList :: [PunycodeDecodeException] -> ShowS #
Exception PunycodeDecodeException # |
Instance details Defined in Data.Text.Punycode.Decode Methods toException :: PunycodeDecodeException -> SomeException # fromException :: SomeException -> Maybe PunycodeDecodeException # displayException :: PunycodeDecodeException -> String #

decode :: ByteString -> Either PunycodeDecodeException Text #

Decode a string into its unicode form