{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ConstraintKinds #-}
module Data.TypedEncoding.Common.Class.Superset where
import Data.TypedEncoding.Common.Util.TypeLits
import Data.TypedEncoding.Common.Types (Enc(..)
, EncodeEx(..)
, Encoding
, getPayload
, runEncoding'
, toEncoding
, AlgNm)
import Data.TypedEncoding.Combinators.Unsafe (withUnsafeCoerce)
import GHC.TypeLits
import Data.Symbol.Ascii
import Data.Either (isLeft)
type family IsSuperset (y :: Symbol) (x :: Symbol) :: Bool where
IsSuperset "r-B64" "r-B64" = 'True
IsSuperset "r-ASCII" "r-ASCII" = 'True
IsSuperset "r-ASCII" "r-B64" = 'True
IsSuperset "r-UNICODE.D76" "r-UNICODE.D76" = 'True
IsSuperset "r-UNICODE.D76" x = Or (IsSuperset "r-ASCII" x) (IsSupersetOpen "r-UNICODE.D76" x (TakeUntil x ":") (ToList x))
IsSuperset "r-UTF8" "r-UTF8" = 'True
IsSuperset "r-UTF8" x = Or (IsSuperset "r-ASCII" x) (IsSupersetOpen "r-UTF8" x (TakeUntil x ":") (ToList x))
IsSuperset "r-CHAR8" "r-ByteRep" = 'True
IsSuperset "r-CHAR8" x = Or (IsSuperset "r-ASCII" x) (IsSupersetOpen "r-CHAR8" x (TakeUntil x ":") (ToList x))
IsSuperset y x = IsSupersetOpen y x (TakeUntil x ":") (ToList x)
type family IsSupersetOpen (big :: Symbol) (nm :: Symbol) (alg :: Symbol) (nmltrs :: [Symbol]) :: Bool
type Superset big small = (IsSuperset big small ~ 'True)
injectInto :: forall y x xs c str . (IsSuperset y x ~ 'True) => Enc (x ': xs) c str -> Enc (y ': xs) c str
injectInto :: Enc @[Symbol] ((':) @Symbol x xs) c str
-> Enc @[Symbol] ((':) @Symbol y xs) c str
injectInto = (str -> str)
-> Enc @[Symbol] ((':) @Symbol x xs) c str
-> Enc @[Symbol] ((':) @Symbol y xs) c str
forall k1 k2 s1 s2 (e1 :: k1) c (e2 :: k2).
(s1 -> s2) -> Enc @k1 e1 c s1 -> Enc @k2 e2 c s2
withUnsafeCoerce str -> str
forall a. a -> a
id
propSuperset' :: forall algb algs b s str . (Superset b s, Eq str)
=>
Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) s algs () str
-> str
-> Bool
propSuperset' :: Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) s algs () str -> str -> Bool
propSuperset' = forall (b :: Symbol) (s :: Symbol) str.
Eq str =>
Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) s algs () str -> str -> Bool
forall (algb :: Symbol) (algs :: Symbol) (b :: Symbol)
(s :: Symbol) str.
Eq str =>
Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) s algs () str -> str -> Bool
propSupersetCheck @algb @algs
{-# DEPRECATED propSuperset' "Use propSupersetCheck or propSuperset_" #-}
propSuperset_ :: forall b s str algb algs. (Superset b s, Eq str, AlgNm b ~ algb, AlgNm s ~ algs) => Encoding (Either EncodeEx) b algb () str -> Encoding (Either EncodeEx) s algs () str -> str -> Bool
propSuperset_ :: Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) s algs () str -> str -> Bool
propSuperset_ = forall (b :: Symbol) (s :: Symbol) str.
Eq str =>
Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) s algs () str -> str -> Bool
forall (algb :: Symbol) (algs :: Symbol) (b :: Symbol)
(s :: Symbol) str.
Eq str =>
Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) s algs () str -> str -> Bool
propSupersetCheck @algb @algs
propSupersetCheck :: forall algb algs b s str . (Eq str)
=>
Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) s algs () str
-> str
-> Bool
propSupersetCheck :: Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) s algs () str -> str -> Bool
propSupersetCheck Encoding (Either EncodeEx) b algb () str
encb Encoding (Either EncodeEx) s algs () str
encs str
str =
case (Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
-> Bool
forall a b. Either a b -> Bool
isLeft Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
rb, Either
EncodeEx (Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str)
-> Bool
forall a b. Either a b -> Bool
isLeft Either
EncodeEx (Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str)
rs) of
(Bool
True, Bool
False) -> Bool
False
(Bool
False, Bool
False) -> str
pb str -> str -> Bool
forall a. Eq a => a -> a -> Bool
== str
ps
(Bool, Bool)
_ -> Bool
True
where
rb :: Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
rb = Encoding (Either EncodeEx) b algb () str
-> Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
forall (alg :: Symbol) (nm :: Symbol) (f :: * -> *)
(xs :: [Symbol]) conf str.
Encoding f nm alg conf str
-> Enc @[Symbol] xs conf str
-> f (Enc @[Symbol] ((':) @Symbol nm xs) conf str)
runEncoding' @algb Encoding (Either EncodeEx) b algb () str
encb (Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str))
-> (str -> Enc @[Symbol] ('[] @Symbol) () str)
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. () -> str -> Enc @[Symbol] ('[] @Symbol) () str
forall conf str.
conf -> str -> Enc @[Symbol] ('[] @Symbol) conf str
toEncoding () (str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str))
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
forall a b. (a -> b) -> a -> b
$ str
str
rs :: Either
EncodeEx (Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str)
rs = Encoding (Either EncodeEx) s algs () str
-> Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str)
forall (alg :: Symbol) (nm :: Symbol) (f :: * -> *)
(xs :: [Symbol]) conf str.
Encoding f nm alg conf str
-> Enc @[Symbol] xs conf str
-> f (Enc @[Symbol] ((':) @Symbol nm xs) conf str)
runEncoding' @algs Encoding (Either EncodeEx) s algs () str
encs (Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str))
-> (str -> Enc @[Symbol] ('[] @Symbol) () str)
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. () -> str -> Enc @[Symbol] ('[] @Symbol) () str
forall conf str.
conf -> str -> Enc @[Symbol] ('[] @Symbol) conf str
toEncoding () (str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str))
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str)
forall a b. (a -> b) -> a -> b
$ str
str
pb :: str
pb = (EncodeEx -> str) -> (str -> str) -> Either EncodeEx str -> str
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either (str -> EncodeEx -> str
forall a b. a -> b -> a
const str
str) str -> str
forall a. a -> a
id (Either EncodeEx str -> str) -> Either EncodeEx str -> str
forall a b. (a -> b) -> a -> b
$ Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str -> str
forall k (enc :: k) conf str. Enc @k enc conf str -> str
getPayload (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str -> str)
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
-> Either EncodeEx str
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
rb
ps :: str
ps = (EncodeEx -> str) -> (str -> str) -> Either EncodeEx str -> str
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either (str -> EncodeEx -> str
forall a b. a -> b -> a
const str
str) str -> str
forall a. a -> a
id (Either EncodeEx str -> str) -> Either EncodeEx str -> str
forall a b. (a -> b) -> a -> b
$ Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str -> str
forall k (enc :: k) conf str. Enc @k enc conf str -> str
getPayload (Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str -> str)
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str)
-> Either EncodeEx str
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol s ('[] @Symbol)) () str)
rs
class EncodingSuperset (enc :: Symbol) where
type EncSuperset enc :: Symbol
implEncInto :: forall xs c str . Enc (enc ': xs) c str -> Enc (EncSuperset enc ': enc ': xs) c str
implEncInto = (str -> str)
-> Enc @[Symbol] ((':) @Symbol enc xs) c str
-> Enc
@[Symbol]
((':) @Symbol (EncSuperset enc) ((':) @Symbol enc xs))
c
str
forall k1 k2 s1 s2 (e1 :: k1) c (e2 :: k2).
(s1 -> s2) -> Enc @k1 e1 c s1 -> Enc @k2 e2 c s2
withUnsafeCoerce str -> str
forall a. a -> a
id
{-# WARNING implEncInto "Using this method at the call site may not be backward compatible between minor version upgrades, use _encodesInto instead." #-}
_encodesInto :: forall y enc xs c str r . (IsSuperset y r ~ 'True, EncodingSuperset enc, r ~ EncSuperset enc) => Enc (enc ': xs) c str -> Enc (y ': enc ': xs) c str
_encodesInto :: Enc @[Symbol] ((':) @Symbol enc xs) c str
-> Enc @[Symbol] ((':) @Symbol y ((':) @Symbol enc xs)) c str
_encodesInto = Enc @[Symbol] ((':) @Symbol r ((':) @Symbol enc xs)) c str
-> Enc @[Symbol] ((':) @Symbol y ((':) @Symbol enc xs)) c str
forall (y :: Symbol) (x :: Symbol) (xs :: [Symbol]) c str.
((IsSuperset y x :: Bool) ~ ('True :: Bool)) =>
Enc @[Symbol] ((':) @Symbol x xs) c str
-> Enc @[Symbol] ((':) @Symbol y xs) c str
injectInto (Enc @[Symbol] ((':) @Symbol r ((':) @Symbol enc xs)) c str
-> Enc @[Symbol] ((':) @Symbol y ((':) @Symbol enc xs)) c str)
-> (Enc @[Symbol] ((':) @Symbol enc xs) c str
-> Enc @[Symbol] ((':) @Symbol r ((':) @Symbol enc xs)) c str)
-> Enc @[Symbol] ((':) @Symbol enc xs) c str
-> Enc @[Symbol] ((':) @Symbol y ((':) @Symbol enc xs)) c str
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Enc @[Symbol] ((':) @Symbol enc xs) c str
-> Enc @[Symbol] ((':) @Symbol r ((':) @Symbol enc xs)) c str
forall (enc :: Symbol) (xs :: [Symbol]) c str.
EncodingSuperset enc =>
Enc @[Symbol] ((':) @Symbol enc xs) c str
-> Enc
@[Symbol]
((':) @Symbol (EncSuperset enc) ((':) @Symbol enc xs))
c
str
implEncInto
propEncodesInto_ :: forall b r str algb algr. (
EncodingSuperset b
, r ~ EncSuperset b
, Eq str
, AlgNm b ~ algb
, AlgNm r ~ algr
) => Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) r algr () str
-> str
-> Bool
propEncodesInto_ :: Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) r algr () str -> str -> Bool
propEncodesInto_ = forall (b :: Symbol) (r :: Symbol) str.
Eq str =>
Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) r algr () str -> str -> Bool
forall (algb :: Symbol) (algs :: Symbol) (b :: Symbol)
(s :: Symbol) str.
Eq str =>
Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) s algs () str -> str -> Bool
propEncodesIntoCheck @algb @algr
propEncodesIntoCheck :: forall algb algr b r str . (Eq str) => Encoding (Either EncodeEx) b algb () str -> Encoding (Either EncodeEx) r algr () str -> str -> Bool
propEncodesIntoCheck :: Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) r algr () str -> str -> Bool
propEncodesIntoCheck Encoding (Either EncodeEx) b algb () str
encb Encoding (Either EncodeEx) r algr () str
encr str
str =
case Encoding (Either EncodeEx) b algb () str
-> Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
forall (alg :: Symbol) (nm :: Symbol) (f :: * -> *)
(xs :: [Symbol]) conf str.
Encoding f nm alg conf str
-> Enc @[Symbol] xs conf str
-> f (Enc @[Symbol] ((':) @Symbol nm xs) conf str)
runEncoding' @algb Encoding (Either EncodeEx) b algb () str
encb (Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str))
-> (str -> Enc @[Symbol] ('[] @Symbol) () str)
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. () -> str -> Enc @[Symbol] ('[] @Symbol) () str
forall conf str.
conf -> str -> Enc @[Symbol] ('[] @Symbol) conf str
toEncoding () (str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str))
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
forall a b. (a -> b) -> a -> b
$ str
str of
Right Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str
r -> case Encoding (Either EncodeEx) r algr () str
-> Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str)
forall (alg :: Symbol) (nm :: Symbol) (f :: * -> *)
(xs :: [Symbol]) conf str.
Encoding f nm alg conf str
-> Enc @[Symbol] xs conf str
-> f (Enc @[Symbol] ((':) @Symbol nm xs) conf str)
runEncoding' @algr Encoding (Either EncodeEx) r algr () str
encr (Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str))
-> (str -> Enc @[Symbol] ('[] @Symbol) () str)
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. () -> str -> Enc @[Symbol] ('[] @Symbol) () str
forall conf str.
conf -> str -> Enc @[Symbol] ('[] @Symbol) conf str
toEncoding () (str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str))
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str)
forall a b. (a -> b) -> a -> b
$ Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str -> str
forall k (enc :: k) conf str. Enc @k enc conf str -> str
getPayload Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str
r of
Left EncodeEx
_ -> Bool
False
Right Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str
_ -> Bool
True
Left EncodeEx
_ -> Bool
True
propCompEncoding :: forall algb algr b r str . Encoding (Either EncodeEx) b algb () str -> Encoding (Either EncodeEx) r algr () str -> str -> Bool
propCompEncoding :: Encoding (Either EncodeEx) b algb () str
-> Encoding (Either EncodeEx) r algr () str -> str -> Bool
propCompEncoding Encoding (Either EncodeEx) b algb () str
encb Encoding (Either EncodeEx) r algr () str
encr str
str =
case Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str)
rr of
Left EncodeEx
_ -> Bool
True
Right Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str
_ -> case Encoding (Either EncodeEx) b algb () str
-> Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
forall (alg :: Symbol) (nm :: Symbol) (f :: * -> *)
(xs :: [Symbol]) conf str.
Encoding f nm alg conf str
-> Enc @[Symbol] xs conf str
-> f (Enc @[Symbol] ((':) @Symbol nm xs) conf str)
runEncoding' @algb Encoding (Either EncodeEx) b algb () str
encb (Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str))
-> (str -> Enc @[Symbol] ('[] @Symbol) () str)
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. () -> str -> Enc @[Symbol] ('[] @Symbol) () str
forall conf str.
conf -> str -> Enc @[Symbol] ('[] @Symbol) conf str
toEncoding () (str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str))
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str)
forall a b. (a -> b) -> a -> b
$ str
str of
Right Enc @[Symbol] ((':) @Symbol b ('[] @Symbol)) () str
_ -> Bool
True
Left EncodeEx
_ -> Bool
False
where
rr :: Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str)
rr = Encoding (Either EncodeEx) r algr () str
-> Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str)
forall (alg :: Symbol) (nm :: Symbol) (f :: * -> *)
(xs :: [Symbol]) conf str.
Encoding f nm alg conf str
-> Enc @[Symbol] xs conf str
-> f (Enc @[Symbol] ((':) @Symbol nm xs) conf str)
runEncoding' @algr Encoding (Either EncodeEx) r algr () str
encr (Enc @[Symbol] ('[] @Symbol) () str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str))
-> (str -> Enc @[Symbol] ('[] @Symbol) () str)
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. () -> str -> Enc @[Symbol] ('[] @Symbol) () str
forall conf str.
conf -> str -> Enc @[Symbol] ('[] @Symbol) conf str
toEncoding () (str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str))
-> str
-> Either
EncodeEx (Enc @[Symbol] ((':) @Symbol r ('[] @Symbol)) () str)
forall a b. (a -> b) -> a -> b
$ str
str
class AllEncodeInto (superset :: Symbol) (encnms :: [Symbol]) where
instance {-# OVERLAPPING #-} AllEncodeInto "r-CHAR8" '[]
instance (AllEncodeInto "r-CHAR8" xs, IsSuperset "r-CHAR8" r ~ 'True, EncodingSuperset enc, r ~ EncSuperset enc) => AllEncodeInto "r-CHAR8" (enc ': xs)
instance {-# OVERLAPPING #-} AllEncodeInto "r-UNICODE.D76" '[]
instance (AllEncodeInto "r-UNICODE.D76" xs, IsSuperset "r-UNICODE.D76" r ~ 'True, EncodingSuperset enc, r ~ EncSuperset enc) => AllEncodeInto "r-UNICODE.D76" (enc ': xs)
instance {-# OVERLAPPING #-} AllEncodeInto "r-UTF8" '[]
instance (AllEncodeInto "r-UTF8" xs, IsSuperset "r-UTF8" r ~ 'True, EncodingSuperset enc, r ~ EncSuperset enc) => AllEncodeInto "r-UTF8" (enc ': xs)
tstChar8Encodable :: forall nms . AllEncodeInto "r-CHAR8" nms => String
tstChar8Encodable :: String
tstChar8Encodable = String
"I am CHAR8 encodable"
tstD76Encodable :: forall nms . AllEncodeInto "r-UNICODE.D76" nms => String
tstD76Encodable :: String
tstD76Encodable = String
"I can be a valid text"
tstUTF8Encodable :: forall nms . AllEncodeInto "r-UTF8" nms => String
tstUTF8Encodable :: String
tstUTF8Encodable = String
"I am a valid UTF8"