[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] Binary versus Text
- From: David Lee <dlee@calldei.com>
- To: Steve Newcomb <srn@coolheads.com>, "xml-dev@lists.xml.org"<xml-dev@lists.xml.org>
- Date: Sun, 24 Nov 2013 15:49:24 +0000
It's all too fuzzy.
I had a recent argument/discussion with a co-worker about if it is accurate (or useful) to consider UTF8 "Text" ...
From the perspective of the archaic (but still implemented) "text mode" file open modifier ... valid UTF8 "Text" was not readable because the control-Z was interpreted as EOF and data would be truncated.
Yet Notepad could read these "Text Files" just fine.
I suggest there is an "intent" or "desire" to categorize <gasp> "files" as "Text" or "Binary" but in reality the distinction is nearly or completely impossible to make accurately and without overlap.
Simple test case:
If a stream or file contains a single byte (hex code 0x20) is it "Text" or "Binary".
Or even more esoteric, is the empty stream text or binary ?
If you cannot answer this definitively I suggest you cannot answer the general case definitively.
To pretend there is a clean categorization has value, but to claim that one actually exists deterministically is folly.
----------------------------------------
David A. Lee
dlee@calldei.com
http://www.xmlsh.org
-----Original Message-----
From: Steve Newcomb [mailto:srn@coolheads.com]
Sent: Sunday, November 24, 2013 10:40 AM
To: xml-dev@lists.xml.org
Subject: Re: [xml-dev] Binary versus Text
As a practical matter, is there *any* difference between text and binary
data *other* than the necessity of worrying about record-end handling in
the former, but not in the latter?
The problem with John's definition is that it begs the question, "What
does 'interpretation as a stream of characters' mean?" For many years,
the Wall Street Journal's editorial policy was to describe data sizes as
numbers of characters or, for large numbers, Encyclopedia Brittanicas,
irrespective of whether the data were in fact characters. The policy
was justified, not only because of the erstwhile naivete of their reader
base, but also, I would argue, because the distinction between
interpretability-as-characters and the lack thereof is not clear.
Regular expressions, for example, are quite useful for detecting
patterns in purely numeric data streams. Does that make such streams
*text*?
Charles Goldfarb used to say, "If there are bugs in a text-processing
system, at least one of them will have to do with record-end handling."
That rule-of-thumb is perhaps dated now, but the absurd
human-productivity-diminishing differences between Unix, Microsoft, and
Apple record-end conventions are still very much with us. It's sort of
like the railroad gauges that did (or did not) descend from the
distances between pairs of ancient chariot wheels; they are the echoes
of empires. (AFAIK, you still have to change trains, or at least
undercarriages, when crossing into Ukraine.)
On 11/24/2013 09:25 AM, Costello, Roger L. wrote:
> Hi Folks,
>
>
>
> Distinguishing "text" versus "binary" is important.
>
>
>
> On October 30 we had a discussion titled, "Is the binary file format dead?"
>
>
>
> During that discussion John Cowan made an excellent distinction between
> binary and text files. I thought it would be useful to summarize the
> distinction.
>
>
>
> The universe of computer files falls into two categories:
>
>
>
> 1. Binary files
>
> 2. Text files
>
>
>
> By convention we normally restrict "binary" to files which are not
> interpretable as streams of characters. [John Cowan]
>
>
>
> The word "text" is applied to files which are interpretable as streams
> of characters.
>
>
>
> Of course any text file is also a binary file, since the class of text
> files is obtained from the class of binary files by applying
> restrictions. But it would be confusing to call a text file a binary
> file; it would be like calling a cat a mammal: correct but imprecise.
>
>
>
>
>
> /Roger
>
_______________________________________________________________________
XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.
[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]