Ross Paterson <ross@soi.city.ac.uk> wrote,
You have the bit about unrepresentable Chars becoming '?' in the legacy byte string part. I think it belongs in locale-dependent CString part. (I believe the single byte conversion discards all but the lower 8 bits, though there's probably no need to say that.)
Oops. I moved the comment. In fact, I added to the locale-dependent CString part the following text: The translation between Unicode and the encoding of the current locale may be lossy. The function \code{charIsRepresentable} identifies the characters that can be accurately translated; unrepresentable characters are converted to `?'.
Other minor things (about old stuff):
* I think the description of newCString, etc needs to say that the memory so allocated may be released using MarshalAlloc.free.
Good point. I added a sentence to that effect.
* CString is said to be NUL-terminated, but presumably CStringLen is not assumed to have a NUL. Perhaps this would be clarified by defining it as (Ptr CChar, Int) instead of (CString, Int) and similarly for CWString.
Ok, I changed the definition of the type synonyms accordingly. Cheers, Manuel