We've run into a problem using Word Perfect's XML editor in WP9 for a TEI
project that is similar to problems discussed on this list 2 or 3 weeks ago
where we are losing special characters. This is for an ALA funded project at
Yale University aimed at publishing Guide to the Literature of Art History
Volume 2. We call the project GLAH. I'm hoping that those who were thinking
about the last set of problems can help shed light on our problem.
In particular, Rafal Prinke asked,
> Is there a list of which Unicode characters (code points)
> have their WordPerfect equivalents? The solution is to have
> the unsupported ones converted to &entities; before loading
> into WordPerfect.
and later stated:
> - but I have just thought about a way
> to generate a list like that myself. If it works, I will put
> it on the Web for others.
Did Rafal have any luck with that list or does someone else know how to get
such a list? What was your general strategy Rafal?
I took Tobias Nehaus's suggestion and looked at the WP SGML newsgroup but
not much was happening there so I thought I'd try presenting my problem
here. Below I describe our general predicament and pose some broader
Our problem is primarily different from the previously discussed problems in
that we are losing the characters on export rather than import. We are
starting with documents written as Word Perfect documents. We are then
converting these WP documents to XML/SGML (we go both ways) roughly
conforming to a modifed TEI DTD. Then we complete the markup using WP9's
XML/SGML editor having compiled our DTD for WP and having assigned enough
styles to help with the hand editing.
The DTD isn't quite an official TEI DTD as we've broken a few rules for
modifing TEI. For example, we have our own doctype element, "GLAH". But
mostly we've conformed to proper TEI modification. We wanted the ready-baked
list of TEI elements and the TEI documentation defining their use, rather
than going off and being creative. We've declared our character set as
isolat1 and use SDATA or CDATA ISO standard entities for everything else.
We needed to start with WP documents because that's what the editors of each
chapter began with some time ago. We devised a system to convert these
documents to "GLAH" documents by first saving the WP files as HTML and then
converting the HTML structure to a rough GLAH structure with an Omnimark
script. This was easier than converting from .rtf or .wpd.
Things first go awry on the conversion to HTML. WP converts isolat1
characters to the correct one byte bit combination which is what we want and
converts many non isolat1 characters to ISO standard SDATA entities, which
is also what we want. It also converts non isolat1, but legitimate "Windows
characters", such as s caron, to their windows byte value, which is not
what we want, but at least these show up as errors when validating with our
SGML declaration, and we can determine what the character should be and
insert the correct entity.
But many other non isolat1 characters are simply deleted with no warning,
and nothing is left in there place, not even a space.
Ok, I figured, probably WP only converts characters to entities with
entities declared in the HTML DTD. (which HTML DTD?) Therefore, I thought,
if I can find all the special characters we use that are neither isolat1 or
have HTML entities, and replace them with an entity-like string, then before
saving as HTML, I can replace the entity like strings with legitimate
entities, make sure they are declared in our GLAH DTD, and we'll be ok. I
say "entity-like" because the "&" gets translated to "&" when saving to
HTML. (The alternative strategy I thought of was to somehow add entity
declarations, to what WP would consider legit, on saving to HTML, but I had
no idea how to do that.)
So that leaves me with the a similar problem to Rafal's. I need a list of
unsupported WP characters. My problem is a bit broader than Rafal's because
I need all the characters WP won't support as HTML. This isn't as bad as it
sounds because I don't need "all" the characters but only the characters
which WP allows our authors/editors to insert in the WP files.
My problem is also harder in that I will need to write a WP macro or some
such to find these characters in the WP files.
With various alternatives strategies in mind, I tried saving the files as
ANSI and as Unicode. In both cases I found some characters were deleted, or
replaced with spaces, without warning.
We have also found that Windows-non-isolat1-characters are deleted without
warning when our XML file is imported as UTF-8. We don't ever really want to
import as UTF-8 because we are using isolat1, but sometimes we've done this
by mistake because if WP sees an XML declaration at the top of a file it
prompts you to use UTF-8. This is regardless of whether we have an encoding
attribute specified in the declaration. We have to tell WP that the file is
an SGML file. It then mangles the xml declarations. Apparently one can't
edit an XML file in WP with a character set other than UTF-8. So we've taken
to editing the files as SGML without XML declarations and adding the
All of this has left me confused with questions about several general
things. If anybody has any insight to the following questions I'd appreciate
- What is the ANSI character set these days? Once upon a time I thought ANSI
was the windows character set. Nowadays I see "Windows character set". I see
"ANSI" much less than I used to. I even have seen computer terminology
dictionaries that don't list ANSI at all as a character set.
- What is a "Word Perfect character". Are some or all of these characters
multi-byte. Where do they vary from "ANSI", "Windows" or "Unicode"
- What is unicode? Is it 2-byte, 4-byte, or variable length? What is UTF-8?
Is it variable length? Is it unicode?
- Do languages like perl understand unicode? How would you search for a
unicode character by number in perl, especially if it is variable length?
- How do people actually manage to use SGML/XML files in unicode? What
software do you use? Don't you have to at least sometimes manipulate these
files in an old fashioned text editor. Can emacs on windows understand
- When will HTML be expected to use unicode as its character set. Which
unicode? Why did isolat1 become the usual character set for HTML Why do some
browsers display non-isolat1 "windows" characters and some don't.
I don't expect answers to even most of these questions but I'm hoping some
questions will be of interest and any answers will help. In general I find
character sets one of the most confusing things to deal with when moving
SGML/XML files in and out of different softwares and converting to
alternative formats. Its one thing that makes SGML not live up to its
promise as a cross-platform format.
West Rock Visions
137 Alden Avenue
New Haven, CT 06515
Phone: (203) 389-0184
Fax: (203) 389-2841
Email: [log in to unmask]