[Haskell-cafe] invalid character encoding

ross at soi.city.ac.uk ross at soi.city.ac.uk
Sun Mar 20 13:42:47 EST 2005


On Sun, Mar 20, 2005 at 12:59:52PM +0000, Keean Schupke wrote:
> How can I do the following (ie what are the new API calls):
> 
>    Open a file with a name that is invalid in the current locale (say a 
> zip disc from a computer with a different locale setting).

A new API is needed for this.

>    Open a file with contents in an unknown encoding.
> 
>    What are the new binary API calls for file IO?

see System.IO

>    What type is returned from 'getChar' on a binary file. Should it 
> even be called getChar? what about getWord8 (getWord16, getWord32 etc...)

Char, of course.  And yes, it's not ideal.  There's also a byte array
interface.

> (I guess I now have to rewrite a lot of file IO code!)

If it was doing binary I/O on H98 Handles, it already needed rewriting.
There's nothing to be done for filenames until a new API emerges.


More information about the Haskell-Cafe mailing list