And finally, to ensure that the SGML output uses the same entity references for these characters as does the SGML input, one could use the following declarations. For transcriptions in scripts not supported by the local character set, entity references may prove unwieldy. Since languages use a variety of writing systems , which in turn use a variety of character repertoires , shifts in language frequently go hand in hand with shifts in character repertoire and writing system. Since language change is frequently of importance in processing a document, even when no character set shift is needed, the encoding scheme defined here provides a global attribute lang to make it possible to mark language shifts explicitly. This attribute may also be used to trigger character-set shifting by application programs.
Some languages use more than one writing system.
Each distinct value of the lang attribute, therefore, represents a single natural language, a single writing system, and a single coded character set. Each value used for the lang attribute must correspond to a writing system declaration suitable for the character set and writing system being used. Like any global attribute, the lang attribute may be used on any element in the SGML document. If the local system requires explicit escape sequences or locking-shift control functions to signal shifts to alternate character sets, these escape sequences may be embedded directly in the content of the appropriate element or may be supplied by the application software upon recognition of the language shift. However, escape sequences are vulnerable to loss or misinterpretation when documents are sent from site to site.