Safe Haskell | None |
---|---|
Language | Haskell2010 |
Flat instances for the text library
Documentation
The desired text encoding can be explicitly specified using the wrappers UTF8Text and UTF16Text.
The default encoding is UTF8:
>>>
tst (UTF8Text $ T.pack "日日日") == tst (T.pack "日日日")
True
A wrapper to encode/decode Text as UTF8 (slower but more compact)
>>>
tst (UTF16Text $ T.pack "aaa")
(True,72,[1,6,97,0,97,0,97,0,0])
>>>
tst (UTF16Text $ T.pack "𐍈𐍈𐍈")
(True,120,[1,12,0,216,72,223,0,216,72,223,0,216,72,223,0])
A wrapper to encode/decode Text as UTF16 (faster but bigger)
Orphan instances
Flat Text Source # | |
Flat Text Source # | Text (and Data.Text.Lazy) is encoded as a byte aligned array of bytes corresponding to its UTF8 encoding.
Strict and Lazy Text has the same encoding:
|