Re: H98 Text IO

2008-03-01 Thread Ben Franksen
David Leuschner wrote: If I write simple program just printing a non-ASCII string to the terminal or to a file I'd expect that I can read it on the screen or using my favorite text editor without having change anything -- neither in my terminal nor in my program. When I run the program on my

Re: H98 Text IO

2008-02-27 Thread Chris Kuklewicz
Small correction: I think ./prog in vs ./prog in and utf8 should be ok. (and I thought this was switched to Glasgow-haskell-users@haskell.org) David Leuschner wrote: Let me try and summarise: Thanks for the great summary! And thanks to Emacs' table mode here're the results displayed as a

Re: H98 Text IO

2008-02-27 Thread Johan Tibell
On Wed, Feb 27, 2008 at 1:06 AM, Duncan Coutts [EMAIL PROTECTED] wrote: As a data point, Java and python use always locale as default if you don't specify an encoding when opening a text stream. I think personally I'm coming round to the always locale point of view. We already have no

Re: H98 Text IO

2008-02-27 Thread Matthew Bentham
- Original Message From: Johan Tibell [EMAIL PROTECTED] To: Duncan Coutts [EMAIL PROTECTED] Cc: Haskell Libraries [EMAIL PROTECTED]; GHC-users list Glasgow-haskell-users@haskell.org; Simon Marlow [EMAIL PROTECTED] Sent: Wednesday, February 27, 2008 9:25:39 AM Subject: Re: H98 Text

Re: H98 Text IO

2008-02-27 Thread Duncan Coutts
On Wed, 2008-02-27 at 08:54 +, Chris Kuklewicz wrote: Small correction: I think ./prog in vs ./prog in and utf8 should be ok. Ah yes, quite right. Similarly ./prog -o out vs ./prog out because neither involve printing to the terminal. Duncan

Re: H98 Text IO

2008-02-27 Thread Jules Bean
Matthew Bentham wrote: It’s not unreasonable to have a program that wants to encode its outputin a particular encoding. The example I gave earlier still seemsreasonable to be, a program that takes input in one encoding andrecodes to a different encoding on its output, with both the input

Re: H98 Text IO

2008-02-26 Thread John Meacham
I came to the same conclusions. I think using either the current encoding or utf8 are perfectly reasonable interpretations of the standard. Jhc used to use the current locale always, but now it uses utf8 always as that was easier to make portable to other operating systems. (though current locale

Re: H98 Text IO

2008-02-26 Thread Simon Marlow
Duncan Coutts wrote: From the H98 report: All I/O functions defined here are character oriented. [...] These functions cannot be used portably for binary I/O. In the following, recall that String is a synonym for [Char] (Section 6.1.2). So ordinary

Re: H98 Text IO

2008-02-26 Thread Roman Leshchinskiy
Duncan Coutts wrote: So here is a concrete proposal: * Haskell98 file IO should always use UTF-8. * Haskell98 IO to terminals should use the current locale encoding. Personally, I'd find this deeply surprising. I don't care that much what locale gets used for I/O (if it

Re: H98 Text IO

2008-02-26 Thread Duncan Coutts
On Tue, 2008-02-26 at 13:22 +, Simon Marlow wrote: So some alternatives that fix this are 1. all text I/O is in the locale encoding (what C and Hugs do) 2. stdin/stdout/stderr and terminals are always in the locale encoding, everything else is UTF-8 I was initially

Re: H98 Text IO

2008-02-26 Thread Duncan Coutts
On Wed, 2008-02-27 at 00:31 +1100, Roman Leshchinskiy wrote: Duncan Coutts wrote: So here is a concrete proposal: * Haskell98 file IO should always use UTF-8. * Haskell98 IO to terminals should use the current locale encoding. Personally, I'd find this deeply

Re: H98 Text IO

2008-02-26 Thread Roman Leshchinskiy
Duncan Coutts wrote: On Wed, 2008-02-27 at 00:31 +1100, Roman Leshchinskiy wrote: Duncan Coutts wrote: So here is a concrete proposal: * Haskell98 file IO should always use UTF-8. * Haskell98 IO to terminals should use the current locale encoding. Personally, I'd find this

Re: H98 Text IO

2008-02-26 Thread Simon Marlow
Simon Marlow wrote: Duncan Coutts wrote: Let's call this one proposal 0: * Haskell98 file IO should always use UTF-8. * Haskell98 IO to terminals should use the current locale encoding. and the others: 1. all text I/O is in the locale encoding (what C and Hugs do)

Re: H98 Text IO

2008-02-26 Thread Simon Marlow
Roman Leshchinskiy wrote: Duncan Coutts wrote: On Wed, 2008-02-27 at 00:31 +1100, Roman Leshchinskiy wrote: Also, would this affect the encoding used for file names? If so, how? No, that's a separate issue. Hmm, so how do I reliably read a list of file names from a file? You didn't say

Re: H98 Text IO

2008-02-26 Thread John Vogel
Why not leave the defaults as they ARE OR USE utf-8 and give the programmer the capability to specify what encoding they want when they want to use a different one? John ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

Re: H98 Text IO

2008-02-26 Thread Chris Kuklewicz
The H98 spec has the inside half of story nailed down: Char is Unicode, and Handles are text I/O that deal in [Char]. The outside half of the story is the binary encoding of the [Char], which was unspecified, and left to the implementation. The implementation dependence allows GHC to create a

Re: H98 Text IO

2008-02-26 Thread Reinier Lamers
Op 26-feb-2008, om 18:42 heeft Chris Kuklewicz het volgende geschreven: The goal is that more complicated situations are reflected in more complicated ghc or main invocations. The least complicated usage defaults to being identical cross-platform and regardless of terminal I/O. I think the

Re: H98 Text IO

2008-02-26 Thread Duncan Coutts
On Tue, 2008-02-26 at 07:28 -0800, John Meacham wrote: On Tue, Feb 26, 2008 at 01:34:54PM +, Duncan Coutts wrote: Personally I'm not really fussed about which compromise we pick. I think the more important point is that all the Haskell implementations pick the same compromise so that

Re: H98 Text IO

2008-02-26 Thread Chris Kuklewicz
Reinier Lamers wrote: Op 26-feb-2008, om 18:42 heeft Chris Kuklewicz het volgende geschreven: The goal is that more complicated situations are reflected in more complicated ghc or main invocations. The least complicated usage defaults to being identical cross-platform and regardless of

Re: H98 Text IO

2008-02-26 Thread Duncan Coutts
On Tue, 2008-02-26 at 14:18 +, Simon Marlow wrote: Simon Marlow wrote: Duncan Coutts wrote: Let's call this one proposal 0: * Haskell98 file IO should always use UTF-8. * Haskell98 IO to terminals should use the current locale encoding. and the others: