Re: Ready for testing: Unicode support for Handle I/O

2009-02-04 Thread Paolo Losi
Max Vasin wrote: Wouldn't it be more correct to separate binary IO, which return [Word8] (or ByteString) and text IO which return [Char] and deal with text encoding? IIRC that was done in Bulat Ziganshin's streams library. That's exactly what I meant. Text IO could be then implemented on to

Re: Ready for testing: Unicode support for Handle I/O

2009-02-04 Thread Paolo Losi
Simon Marlow wrote: The only change to the existing behaviour is that by default, text IO is done in the prevailing encoding of the system. Handles created by openBinaryFile use the Latin-1 encoding, as do Handles placed in binary mode using hSetBinaryMode. wouldn't be semantically correct fo

Re: [Haskell-cafe] Ready for testing: Unicode support for Handle I/O

2009-02-03 Thread John Goerzen
Duncan Coutts wrote: > Sorry, I think we've been talking at cross purposes. I think so. >> There always has to be *some* conversion from a 32-bit Char to the >> system's selection, right? > > Yes. In text mode there is always some conversion going on. Internally > there is a byte buffer and a ch

Re: [Haskell-cafe] Ready for testing: Unicode support for Handle I/O

2009-02-03 Thread Duncan Coutts
On Tue, 2009-02-03 at 17:39 -0600, John Goerzen wrote: > On Tue, Feb 03, 2009 at 10:56:13PM +, Duncan Coutts wrote: > > > > Thanks to suggestions from Duncan Coutts, it's possible to call > > > > hSetEncoding even on buffered read Handles, and the right thing > > > > happens. So we can read fr

Re: [Haskell-cafe] Ready for testing: Unicode support for Handle I/O

2009-02-03 Thread John Goerzen
On Tue, Feb 03, 2009 at 10:56:13PM +, Duncan Coutts wrote: > > > Thanks to suggestions from Duncan Coutts, it's possible to call > > > hSetEncoding even on buffered read Handles, and the right thing > > > happens. So we can read from text streams that include multiple > > > encodings, such as

Re: [Haskell-cafe] Ready for testing: Unicode support for Handle I/O

2009-02-03 Thread Duncan Coutts
On Tue, 2009-02-03 at 11:03 -0600, John Goerzen wrote: > Will there also be something to handle the UTF-16 BOM marker? I'm not > sure what the best API for that is, since it may or may not be present, > but it should be considered -- and could perhaps help autodetect encoding. I think someone el

Re: [Haskell-cafe] Ready for testing: Unicode support for Handle I/O

2009-02-03 Thread John Goerzen
Simon Marlow wrote: > I've been working on adding proper Unicode support to Handle I/O in GHC, > and I finally have something that's ready for testing. I've put a patchset > here: Yay! Comments below. > Comments/discussion please! Do you expect Hugs will be

Ready for testing: Unicode support for Handle I/O

2009-02-03 Thread Simon Marlow
I've been working on adding proper Unicode support to Handle I/O in GHC, and I finally have something that's ready for testing. I've put a patchset here: http://www.haskell.org/~simonmar/base-unicode.tar.gz That is a set of patches against a GHC repo tree: unpack the tarbal

Re: A question about Unicode support

2001-09-11 Thread Marcin 'Qrczak' Kowalczyk
Tue, 11 Sep 2001 13:19:54 -0300 (GMT), Pablo Pedemonte <[EMAIL PROTECTED]> pisze: > Ghc 5.00.2 provides (initial) Unicode support, so I thought the > chr function would do. But it seems it still rejects Int values > greater than 0xFF. It doesn't. -- __("<

A question about Unicode support

2001-09-11 Thread Pablo Pedemonte
Hi all! The question is really simple: how can I convert an Int into a Char? Ghc 5.00.2 provides (initial) Unicode support, so I thought the chr function would do. But it seems it still rejects Int values greater than 0xFF. So, what function shoud I use? Thanks in advance. Regards, Pablo

Re: Unicode support

1998-04-24 Thread Frank A. Christoph
>> What is the status of the lastest release (3.01) with respect to Unicode >> support? Is it possible to write source in Unicode? How wide are >> characters? Do the I/O library functions support it? etc. > >I don't believe that we've done anything much

Unicode support

1998-04-23 Thread Frank A. Christoph
What is the status of the lastest release (3.01) with respect to Unicode support? Is it possible to write source in Unicode? How wide are characters? Do the I/O library functions support it? etc. --FC