Re: Bytewise u??_conv_from_encoding

2022-01-06 Thread Marc Nieper-Wißkirchen
Am Mi., 5. Jan. 2022 um 21:59 Uhr schrieb Bruno Haible : > > Hello Marc, > [...] > > If I understand your classification correctly, I meant something more > > like (E) than (D), I think. As an interface, I would propose would be > > something along the following lines: > > > > decoder_t d =

Re: Bytewise u??_conv_from_encoding

2022-01-05 Thread Bruno Haible
Hello Marc, > > (A) Using a pipe at the shell level: > > iconv -t UTF-8 | my-program > > > > (B) Using a programming language that has a coroutines concept. > > This way, both the decoder and the consumer can be programmed in > > a straightforward manner. > > > > (C) In C, with

Re: Bytewise u??_conv_from_encoding

2022-01-01 Thread Marc Nieper-Wißkirchen
Hi Bruno, thanks for your insights, valuable as always. Am Sa., 1. Jan. 2022 um 13:57 Uhr schrieb Bruno Haible : > > Hi Marc, > > > The demand to read a file (in local encoding) and to decode it > > incrementally seems a typical one. > > There are four ways to satisfy this demand. > > (A) Using

Re: Bytewise u??_conv_from_encoding

2022-01-01 Thread Bruno Haible
Hi Marc, > The demand to read a file (in local encoding) and to decode it > incrementally seems a typical one. There are four ways to satisfy this demand. (A) Using a pipe at the shell level: iconv -t UTF-8 | my-program (B) Using a programming language that has a coroutines concept.

Bytewise u??_conv_from_encoding

2022-01-01 Thread Marc Nieper-Wißkirchen
The demand to read a file (in local encoding) and to decode it incrementally seems a typical one. With Gnulib, this can be done using the mbfile module to read in the multibytes byte-by-byte and then using the striconveh module to decode the multibytes in, say, UTF-8 or UTF-32. This, however,