You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it's very strange, the first print with show is success, but the second fail!
import qualified Data.Aeson as J (encode)
import Data.ByteString.Lazy.Char8 as BLC (unpack)
import Data.Map (Map, singleton)
(=:) = singleton
main :: IO ()
main = do
let jsonValue = "id" =: "140502198811102244"
<> "cell" =: "13986671110"
<> "name" =: "罗浩"
<> "meal" =: "Execution"
let jsonData = BLC.unpack $ J.encode jsonValue
putStrLn (show jsonData)
putStrLn jsonData
[op@my-200 callJava]$ etlas run
Up to date
"{\"cell\":\"13986671110\",\"id\":\"140502198811102244\",\"meal\":\"Execution\",\"name\":\"\231\189\151\230\181\169\"}"
{"cell":"13986671110","id":"140502198811102244","meal":"Execution","name":"Exception in thread "main" eta.runtime.exception.EtaException: <stdout>: commitBuffer: invalid argument (invalid character)
at base.ghc.TopHandler$runMainIO2.call(TopHandler.hs)
at base.ghc.TopHandler$runMainIO2.apply1V(TopHandler.hs)
at eta.runtime.exception.Exception.catch_(Exception.java:166)
at main.Main$main22.call(Main.hs)
at main.Main$DZCmain.call(Main.hs:62)
at main.Main$DZCmain.applyV(Main.hs:62)
at eta.runtime.stg.Closures$EvalLazyIO.enter(Closures.java:152)
at eta.runtime.stg.Capability.schedule(Capability.java:246)
at eta.runtime.stg.Capability.scheduleClosure(Capability.java:202)
at eta.runtime.Runtime.evalLazyIO(Runtime.java:392)
at eta.runtime.Runtime.main(Runtime.java:385)
at eta.main.main(Unknown Source)
Caused by: eta.runtime.exception.EtaException: <stdout>: commitBuffer: invalid argument (invalid character)
at base.ghc.io.handle.Internals$sat$2.apply1V(Internals.hs:173)
at eta.runtime.exception.Exception.catch_(Exception.java:166)
at base.ghc.io.handle.Internals$$wa2.call(Internals.hs:167)
at base.ghc.io.handle.Internals$a3.applyV(Internals.hs:133)
at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
at base.ghc.io.handle.Internals$$wa4.call(Internals.hs:131)
at base.ghc.io.handle.Internals$$wa3.call(Internals.hs:237)
at base.ghc.io.handle.Internals$wantWritableHandle1.call(Internals.hs:227)
at base.ghc.io.handle.Text$$wa8.call(Text.hs:630)
at base.ghc.io.handle.Text$hPutStr2.call(Text.hs:553)
at main.Main$main1.call(Main.hs:71)
at main.Main$main1.applyV(Main.hs)
at eta.runtime.exception.Exception.catch_(Exception.java:129)
... 9 more
Caused by: eta.runtime.exception.EtaException: recoverEncode: invalid argument (invalid character)
at base.ghc.io.encoding.Failure$$wa2.call(Failure.hs:199)
at base.ghc.io.encoding.Failure$$wa1.call(Failure.hs:166)
at base.ghc.io.encoding.Failure$recoverEncode1.call(Failure.hs)
at base.ghc.io.encoding.Latin1$sat$40.apply2V(Latin1.hs:107)
at base.ghc.io.handle.Internals$a2.apply2V(Internals.hs:393)
at base.ghc.io.handle.Internals$$wa.call(Internals.hs:376)
at base.ghc.io.handle.Internals$$wa6.call(Internals.hs:518)
at base.ghc.io.handle.Text$sat$147.apply1V(Text.hs:605)
at base.ghc.io.handle.Internals$sat$56.apply1V(Internals.hs:256)
at eta.runtime.apply.PAP1_1.applyV(PAP1_1.java:19)
at eta.runtime.exception.Exception.catch_(Exception.java:129)
... 20 more
The text was updated successfully, but these errors were encountered:
Mmm, maybe the error is caused by Data.ByteString.Lazy.Char8.unpack, it only handles valid ascii chars, right?
Maybe you can use Data.ByteString.UTF8.toString from utf8-string package instead?
it's very strange, the first print with show is success, but the second fail!
The text was updated successfully, but these errors were encountered: