Adobe 65030365 Developer's Guide - Page 86
Specifying the character encoding for XML files, Display encoding, Working with Special Files, PCDATA
UPC - 883919170923
View all Adobe 65030365 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 86 highlights
7 Application definition file Specifying the character encoding for XML files The XML specification supports UNICODE characters for document content and markup tokens. In XML the given encoding is specified in the document prolog. The following example shows a specification for ShiftJIS character encoding: The XML specification states that an XML document must either specify an encoding in the prolog, or it must be UTF-8 or UTF-16. FrameMaker follows this specification by assuming UTF-8 by default if there is no encoding specified in the XML file. If you read an XML file with character encoding that doesn't match either the declared encoding or the default encoding (if no encoding is declared), it is likely that the import process will encounter a character that doesn't match the encoding FrameMaker uses. In that case, you will get a parsing error that says the document is not well-formed due to a bad token. FrameMaker uses the encoding statement in the document prolog to determine which encoding to use. The statement must specify one of the encodings supported by your specific FrameMaker installation. FrameMaker ships with support for the following encodings: Big5 EUC-CN EUC-JP EUC-KR EUC-TW GB2312 ISO-8859-1 KSC_5601 macintosh Shift_JIS US-ASCII UTF-16 UTF-8 windows-1252 You can add other encodings to your FrameMaker installation-see "Unicode and character encodings" on page 27. FrameMaker converts the encoding of the XML document to an internal display encoding. In this way FrameMaker fully supports Unicode characters for text that is in #PCDATA, RCDATA, and CDATA. For any #PCDATA character that it cannot interpret, FrameMaker uses a marker of type UNKNOWNCHAR to represent the character. For unknown CDATA characters, FrameMaker uses XML character references. The following sections describe how to control the display encoding that FrameMaker uses, and how to specify an encoding when you save a document as XML. Display encoding On import, FrameMaker converts the XML encoding to a display encoding that is appropriate for a given language. However, FrameMaker cannot automatically determine which conversion to make. Although the XML document prolog specifies an encoding, the document may contain elements or other constructs that override the language implied by Working with Special Files 68