Re: ASCII Character to Text Conversion
- From: "Jeff Johnson" <i.get@xxxxxxxxxxx>
- Date: Fri, 26 Sep 2008 11:52:59 -0400
"Jeff Johnson" <i.get@xxxxxxxxxxx> wrote in message
news:ub4jdq%23HJHA.1160@xxxxxxxxxxxxxxxxxxxxxxx
I have a VB 6 app that needs to have functionality to read in information
from a Visual FoxPro table. One of the fields is in ASCII character
format.
Does anyone know of any functionality that will convert the ASCII
character
to standard 'English' text?
Uhhh...what? I have a feeling you don't understand what ASCII is. Have you
looked in this FoxPro table to see the "weird" data contained in this
field? I bet it'll be quite legible....
Okay, this got me going, so please give me a minute for a semi-rant.
OPEN LETTER TO THE WORLD:
Please, everyone who does this, stop using the phrase "ASCII format." ASCII
is not a format, it is an encoding scheme. What's the difference? I'll tell
you.
"Format" refers to structure, a physical layout. Comma-delimited,
tab-delimited, fixed-width files--all of these are formats because they
define a structure that decribes how the data within them is stored.
Likewise for HTML and XML. Date formats like mm/dd/yyyy, dd/mm/yyyy,
yyyy-mm-dd all define a structure: how the parts of a date are physically
arranged for display and how they are to be interpreted when read.
An "encoding scheme" is nothing more than a translation matrix, a lookup
table. The word "code" is contained in there, and for good reason: an
encoding scheme serves to turn something human-recognizable (letters and
digits, for example) into something less recognizable (numbers). Numbers are
the only thing computers understand, so to store letters we have to turn
them into numbers, but we also need to be able to turn them back into
letters so that we can read them.
Here's a simple encoding: I'll write my name using a code which simply
converts a letter into a number based on its position in the alphabet (A
being 1 and Z being 26). This particular encoding makes no distinction
between upper- and lower-case letters.
10 5 6 6 [10 = J, 5 = E, 6 = F (twice)]
ASCII does the same thing, except it defines 128 things and not just the 26
letters of the alphabet that my simple code did. The first 32 (0 - 31) don't
represent displayable characters but rather contain control codes that were
useful on older terminals (and many of which still work on a command
prompt). 32 - 127 represent characters which, if not completely visible
(like a space), still occupy physical...uh...space. The letters A - Z are
represented twice, once in upper-case (65 - 90) and once in lower (97 -
122). All ACSII characters can be represented with a single byte.
Unicode is another encoding scheme which attempts to encode every possible
character in all languages on Earth, and to do so it uses bigger numbers and
potentially more than one byte to hold those numbers (which leads to all
sorts of fun in the various FORMATS used to manage an ENCODING SCHEME--ha!).
My point is that nothing can be "formatted as ASCII" because ASCII doesn't
describe how various characters are to be laid out. It simply says "65 = A,
49 = 1, 63 = ?, 98 = b, etc." The following lines all contain ASCII
characters:
1,West,2008-01-03
<id>1</id><region>West</region><processDate>2008-01-03</processDate>
1 West 2008-01-03
but they have been formatted (laid out) in different ways. You would need to
know the format to properly process the data they contain, but no matter
what, the "W" is always represented by 87.
.
- Follow-Ups:
- Re: ASCII Character to Text Conversion
- From: Henning
- Re: ASCII Character to Text Conversion
- References:
- ASCII Character to Text Conversion
- From: Rob
- Re: ASCII Character to Text Conversion
- From: Jeff Johnson
- ASCII Character to Text Conversion
- Prev by Date: Re: Fast ListView
- Next by Date: Re: ASCII Character to Text Conversion
- Previous by thread: Re: ASCII Character to Text Conversion
- Next by thread: Re: ASCII Character to Text Conversion
- Index(es):
Relevant Pages
|
Loading