On Apr 23, 2007, at 11:39 AM, Arnaud Nicolet wrote:

> Just a question here: why did other encodings start from a base (the
> ascii)?
> They could keep a 7 bits scheme and be a completely-independent
> encoding.
>
> By the way, 8 bits is not required for an encoding, right?

Exactly.  In fact ASCII is a 7-bit encoding.  The fact that most  
computers adapted an 8-bit byte meant there were "extra" characters  
available -- by using that 8th bit, the number of possible characters  
doubled from 128 to 256.

Lots of people refer to these extra characters as "high ASCII".   
Which it isn't because ASCII is a 7-bit encoding.  But it is a clear  
way to refer to the characters made possible by the using the extra bit.

Since an encoding is just a defined way of representing characters in  
binary, an encoding can be any length that fits your needs.  6 bits.  
8- 9- 12- 16-bits, whatever.  Binary Coded Decimal codes the digits  
0-9 in a 4-bit encoding, allowing 2 digits per byte.

> Do you know how one can make an encoding?

You just make it up.  Say you want to have the 26 Roman alphabet  
characters, uppercase only.  There are 26 characters, so you need 5  
bits.  5 bits will allow 32 characters, so your 26 will fit nicely.   
Now make a table:

00001 - A
00010 - B
00011 - C
00100 - D
00101 - E
...
11010 - Z

Now you adhere to it.  When your program encounters "00001" in a  
binary string, it knows it's an "A", etc.  Plus you have to decide  
how to store it in an 8-bit world.  Will you pad the front with zeros  
to make your 5-bit encoding fit in an 8-bit byte?  This would leave  
you with 3 "High Arnaud" bits that people might find a use for since  
you're not using them.  Or you could pack them, three 5-bit  
characters into a 16-bit word (with 1 left over).  But then you have  
to build packing and un-packing routines.

Of course, since we live in an ASCII/Unicode world, you'd have to  
make ASCII/Unicode to Arnaud and Arnaud to ASCII/Unicode conversion  
routines.

> Say I want to make an encoding named "Arnaud" (a really strange
> encoding where letters are animated and in half-blue and half-green),
> how could I start?

In the olden days, you'd build it into the Arnaud character generator  
chip for your terminal or microcomputer.  Now, you'd use a font  
creation program like Fontographer or Font Lab.  But since neither  
TrueType nor Postscript support animation, you'd probably have to  
create your own Arnaud rendering engine in a canvas or something to  
draw your animations.

Kirk

-----------------------------------------------
REALbasic Professional 2007r1
MacBook Core Duo, Mac OS X 10.4.9





_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to