Please provide peekUTF8CString and withUTF8CString #32

joshtriplett opened this Issue Jul 4, 2012 · 3 comments


None yet
2 participants

Most UNIX APIs work in UTF-8, not UTF-16. Rather than having to write wrappers that encode/decode UTF-8 and run ByteString's packCString and useAsCString functions (and the corresponding ...Len variants), please consider providing these functions directly in either Data.Text.Foreign or Data.Text.Encoding. Such wrappers would make c2hs bindings easier to write.


bos commented Jan 15, 2013

Happy to consider this, if you've an idea of what the APIs should specifically look like.

Same type signatures as peekCString and withCString, using the CString type, but accepting/producing UTF-8 respectively.

bos closed this Sep 22, 2013

That commit added the Len variants, but not the peekUTF8CString and withUTF8CString functions needed to work with the much more common NUL-terminated UTF-8. Could you please add that pair of functions as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment