Text I/O library proposal, first draft

Ashley Yakeley ashley@semantic.org
Tue, 5 Aug 2003 21:37:49 -0700


At 2003-08-05 20:24, Ben Rudiak-Gould wrote:

>1. We don't really need to work out a single recoder interface that's best
>for every purpose.

Well, something has to be in the library. Certainly I'd like to see pure 
(non-IO) encodings: if these are fast enough, and we have all the 
available ones, it might be appropriate to define all others in terms of 
that.

Otherwise I suppose there could be a base interface for pure encodings 
and a base interface for IO-based encodings. This of course would be less 
desirable from a purist viewpoint.

>2. There are regional encodings in use which are not stateless (JIS is the
>only one I know of personally), so I think that a currentLocaleEncoding
>function will have to return a stateful interface.

OK

>We have little choice but to use the C library's tables,
>and the only interface to them is the C conversion functions.
...
>4. Existing C conversion libraries (whose interfaces we can't change)
>store their state in opaque data structures and provide no way to copy
>that state.

Which conversion library were you thinking of? This is true for iconv, 
which has a very simple interface, but apparently not for libc: see 
<http://www.gnu.org/manual/glibc-2.2.5/html_node/Keeping-the-state.html>


-- 
Ashley Yakeley, Seattle WA