Skip to content

Please provide peekUTF8CString and withUTF8CString #32

Closed

Description

@joshtriplett

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.

Activity

  1. bos commented on Jan 15, 2013

    @bos
    Contributor

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

  2. joshtriplett commented on Jan 15, 2013

    @joshtriplett
    Author

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

  3. joshtriplett commented on Sep 22, 2013

    @joshtriplett
    Author

    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?

  4. added 3 commits that reference this issue on Mar 13, 2019
    32ab7e3
    0bcbdd0
    caa1112
  5. added a commit that references this issue on Apr 6, 2021
    d5b40df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions