[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: special characters in 3+
- Subject: Re: special characters in 3+
- From: Carl Distefano CLDistefano@xxxxxxxx
- Date: Tue, 21 Sep 1999 05:53:50 +0000
Reply to note from Alison Tartt Mon, 20 Sep 1999
21:30:51 -0500
-> I've been given some xywrite 3+ files with special Spanish
-> characters (¡, ¢, ?, etc.) that are showing up in a DOS editor
-> as A1, A2, A4, 82, etc. When I open the files within xywrite,
-> the characters display correctly on screen, ...
What's happened is that the conversion program (unnecessarily, it
would seem) translated those accented characters into Xy's 3-byte
character set. If you examine the file in a hex editor, you'll see
that each of those codes "A1, A2, A4, 82" is preceded by an Ascii-
255 (FF hex). The codes are the hexadecimal equivalents of the
corresponding 1-byte chars in decimal. Thus A1 hex equals 161
decimal, and Ascii-255 followed by A1 is XyWrite's 3-byte visual
equivalent of a 1-byte Ascii-161, or a lower case i acute.
-> Once I open the files in xywrite, I can't search on any of
-> these special characters, so the character " " obviously isn't
-> the ASCII character 160.
Right. It looks like an a acute, but at the DOS level it actually
consists of Ascii-255 followed by A0, the hex equivalent of 160.
But, as a matter of fact, you *can* SEarch for these 3-byte
characters! What you need is a dedicated Ascii-255 key. Open your
KBD file and choose a key, to which assign a single Ascii-255
character, produced by holding down Ctrl-Alt, hitting 2, 5, 5, and
then releasing Ctrl-Alt. (Your setup may use some other shift-key
combination. Press whatever shift keys you normally use to produce
Ascii chars.) SAve and reload the keyboard file.
Now open the file that has these special characters. Blank the
command line and type SE / A1/, where the first character in the
search string is the character produced by your newly-created 255
key. You'll see that this SEarch statement finds the 3-byte
lowercase i acute. Changing each instance of the 3-byte char to its
1-byte equivalent is a simple matter of executing CI / A1/¡/ from
the top of the file. (Whether you actually need to make these
changes is a function of how the Xy-to-Mac conversion program treats
them. You might try sending your correspondent two versions of the
document, one with 3-byters, the other with all normal chars, and
have her compare the results.)
Now, just for fun, move the cursor into the text area, hit your 255
key and see what happens. Nothing -- or so it seems. What's
actually happening is that Xy is waiting for you to hit two more
keys so that it can produce a 3-byte char! Now hit an A, followed
by a 1 (case doesn't matter). Voilþ, you get a 3-byte i acute! Now
you know how to produce 3-byters in text and on the CMline. Note
how placing a 3-byter on the CMline visually explicates the
underlying constituent bytes, whereas placing it in text produces
the char as it will display when printed. (This isn't true, by the
way, in Xy4, where 3-byters display as printables both in text and
on the command header.)
What are these 3-byters good for? An important use is to produce
printable versions of control characters -- characters that "do
something" other than simply represent themselves. A good example
is the tab. Normally, when you hit the tab key, you want to create
white space. But if you're writing about the tab character itself,
you need a way of producing a printable version of it; the solution
is to embed a 3-byte tab, Ascii-255 followed by 09 (try it). It's
usually unnecessary to embed non-control characters (like the
accented chars in your document) in 3-byte form.
-> If this is a hopelessly elementary issue, please reply off-
-> line.
Not so elementary! But fundamental. (And useful.) To get a firm
handle on this topic, read Robert Holmgren's CTRLCHAR.TXT, which can
be downloaded at XyWWWeb.
--------------
Carl Distefano
CLDistefano@xxxxxxxx
http://users.datarealm.com/xywwweb/
®LM¯®RM80DI¯