[haskell]UTF8へのencode
UTF-8へのエンコードは2種類ある。
1 2 3 4 5 6 7 |
module Main (main) where import qualified Codec.Binary.UTF8.String as US main = do s < -getContents print $ US.encode s print $ US.encodeString s |
1 2 3 |
$ ./main あ[227,129,130] "\227\129\130" |
[crayon-6801eba9cdd21046 …