[Haskell-cafe] posting UTF8 data with Curl library

Daniel Fischer daniel.is.fischer at web.de
Wed May 5 17:15:05 EDT 2010


On Wednesday 05 May 2010 23:05:10, Eugeny N Dzhurinsky wrote:
> Hello!
>
> I need to submit data to HTTP server using UTF8 encoding. I found out
> that libcurl for haskell can work with Data.ByteString - but it seems
> not able to work with Data.ByteString.UTF8.
>
> Can you please advice, how do I convert Data.ByteString.UTF8 into
> Data.ByteString and visa versa?

It's the same type, so you can encode it using Data.ByteString.UTF8 and 
send it over the network as a plain old ByteString.
On the receiving end, you read it as a plain ByteString and then interpret 
it as a utf-8 encoded ByteString.

>
> Thank you in advance!



More information about the Haskell-Cafe mailing list