[Haskell-cafe] Re: String vs ByteString

Daniel Fischer daniel.is.fischer at web.de
Fri Aug 13 11:52:52 EDT 2010


On Friday 13 August 2010 17:27:32, Sean Leather wrote:
> Which one do you use for strings in HTML or XML in which UTF-8 has
> become the commonly accepted standard encoding? It's text, not binary,
> so I should choose Data.Text. But isn't there a performance penalty for
> translating from Data.Text's internal 16-bit encoding to UTF-8?

Yes there is.
Whether using String, Data.Text or Data.ByteString + Data.ByteString.UTF8 
is the best choice depends on what you do. Test and then decide.


More information about the Haskell-Cafe mailing list