Hi,

First of all, were you hoping to get this into the 2009-01-15 release?

I'm somewhat nervous about this, but I'll trust you if think this really
is the right way to go.

On Sat, Dec 27, 2008 at 18:09:14 -0800, Judah Jacobson wrote:
> Yes, that's right.  For example:
> 
> Prelude> getLine
> [user input:]α
> "\206\177"
> Prelude> :m +System.Console.Haskeline
> Prelude System.Console.Haskeline> runInputT defaultSettings $ getInputLine ""
> [user input:]α
> Just "\945"
> 
> Haskeline decodes the two bytes into one Char, but Darcs expects to
> receive the encoded string since it uses standard functions like
> writeFile, putStr, etc. which ignore all but the last 8 bits of each
> Char input.

It sounds like if we're going to be manipulating Char, we ought to be
able to trust that they really are Unicode characters, and not just
padded placeholders for 8-bit chars.

That's why I'm a bit nervous about this patch, the risk of re-inforcing
this 8-bit placeholder use of Char.  I wonder if a medium-term solution
would be for darcs to avoid using Char for user input and use something
which is more honest about its contents.  In the long term, the ideal
would be to use Char, and to be able to know what to expect from it.

I realise this is probably more involved than you were expecting to get
into it, and that the medium term proposal may not be very realisitic.
Barring a bigger picture rewrite, we should probably at least put huge
warning flags explaining the sins that we are about to commit with this
UTF8.encode (I say 'abuse' without intending any offense).

> > Also, what if the user is not using UTF-8 (ugh!) in their terminal?
> 
> Haskeline currently can't handle encodings besides ASCII or UTF-8 on
> POSIX systems.  (I'm hoping to fix that soon.)  How serious of a
> concern is this?

I'm not sure.  It may be worth asking our European friends, who still
encounter computers that use ISO-8859-1 and other such encodings

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9

Attachment: pgpDQyGhmrE8C.pgp
Description: PGP signature

_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to