
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? Thank you in advance! -- Eugene Dzhurinsky

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!

On Wed, May 05, 2010 at 11:15:05PM +0200, Daniel Fischer wrote:
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.
Okay, I will give it a try. Seems like everything should be pretty simple and straightforward. Thank you! -- Eugene N Dzhurinsky
participants (3)
-
Daniel Fischer
-
Eugene Dzhurinsky
-
Eugeny N Dzhurinsky