Site Menu Project Specification Implementation Recommendations Reference Needs Updating Work in Progress Wastebasket Wiki Manual |
TransliterationEncoding Modula-2 in Legacy Character SetsModula-2 syntax is based on the ASCII character set. Nevertheless, care has been taken to allow reversible transliteration to and from legacy character sets via source code transliteration utilities to accommodate Modula-2 on computer systems that do not support ASCII or Unicode. The recommendations described here require at minimum the availability of the following printable characters:
Recommended TransliterationsImplementors of transliteration utilities may choose whichever digraph or trigraph transliterations they see fit provided that the transliterations are reversible. However, the following transliterations are recommended as their digraphs have been reserved:
Recording the Encoding in the SourceIt is mandatory for any Modula-2 source file that is not ASCII encoded to record the character encoding using an Example:
Transliteration Within Quoted LiteralsWhere transliteration is applied within quoted string literals, it is recommended to prefix the string literal with a period. It is further recommended to separate transliterated symbols from the remaining string literal by factoring and concatenation. This way it becomes visible in the transliterated source text exactly which part of a string literal has been transliterated, avoiding accidental transliterations. Example: Transliteration Within CommentsWhere transliteration is applied to block comments, it is recommended to prefix the comment with a question mark. As with string literals, it is recommended to separate and isolate transliterated symbols from the remaining comment by splitting the comment into several comments to make it visible exactly which part of the comment has been transliterated. Example: Where transliteration is applied to line comments, it is recommended to use Example: Transliteration of Character CodesWhere specific character code points are hardcoded in transliterated source text, it is recommended to prefix the character code with Examples:
Double Quotation MarkIn the now unlikely event that the legacy character set does not provide an encoding for Example: However, if the legacy character set provides an encoding for the vertical bar, one may use Example: Case SensitivityIn the now unlikely event that the legacy character set does not support case sensitivity, it is recommended to use Example: |