[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binary vs non-binary ports

Hans Oesterholt-Dijkema wrote:

I think, one should not interfere with the creative process of software engineers by limiting the possibilities of the language at hand.

I get nervous when I hear about the "creative process of software

2. In the protocol of many instant messengers, both text and
binary protocols are mixed. To communicate a ZIP file, binary
protocol is used, to communicate (meta) information, text
protocol is used.

Well, yes.  The points I'm making are:
* One layers text i/o on top of binary i/o.
* A SRFI for binary i/o has to specify how to open a file
in "binary mode".
* Portable programs cannot assume they can do binary i/o
on ports opened in the default character mode, unless we
make unreasonable demands on implementors.
* Reading/writing characters/strings from/to character
mode ports is tricky.
* Most file formats that mix text and binary i/o do *not* handle
general strings: often they only support whatever character encoding
the "creative" engineers are most familiar with.
* I/O APIs designed by people unfamiliar with internationalization
issues often have problems in today's internationalized world.
* A quick-and-dirty fix is often to specify that strings are in UTF8.
	--Per Bothner
per@xxxxxxxxxxx   http://per.bothner.com/