Ticket #113 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Use CAString FFI functions instead of CString ones

Reported by: batterseapower Owned by:
Priority: minor Milestone:
Version: Keywords:
Cc:

Description

Haskeline uses Foreign.C.String.*CString to marshal locale names. Locale names will always be encoded in ASCII, so it would probably be prudent to use the *CAString variants instead to prevent use of the locale encoding from screwing things up.

Attached patch achieves this.

Attachments

Haskeline-Unicode.dpatch (3.2 kB) - added by batterseapower 3 years ago.

Change History

Changed 3 years ago by batterseapower

Changed 3 years ago by judah

Thanks for the patch! Out of curiosity, do you know of any pending plans to switch over the Foreign.C.String functions to use the locale's encoding? (My understanding is that currently the CString and CAString functions behave the same.)

Either way, though, this patch seems fine to apply.

Changed 3 years ago by batterseapower

Yes, I'm working on doing it :-). I've been checking GHC and its boot libraries for suspicious use of the *CString functions hence this patch.

Changed 3 years ago by judah

  • status changed from new to closed
  • resolution set to fixed

Ah, that explains it. :-) I've applied the patch to the repo at http://code.haskell.org/haskeline. Thanks again!

Note: See TracTickets for help on using tickets.