(C) 2000, 2001 David Rushall
FlexHTML is a simple OPM to process text files and apply template macros. As a file is processed, special template commands invoke user-written OPL functions to generate a block of output.
It was originally designed to aid the development and maintenance of my web site, where the OPL templates are used to:
All this is from source held in OPL Program editor files for convenience of editing. When the time comes to give the site a new look or a new page is needed on the navigation bars, some changes to the OPL templates can be easily propagated to all pages on the site.
With a little work the module could be applied to other scenarios, such as extracting a database of bookmarks to form an HTML links page or generating both an HTML and Help/Data version of an application's user manual from a single source. Advanced HTML applications can also employ temporary outputs and multiple passes to build a table of contents of automatically numbered sections or float footnotes to the end of the document.
Using FlexHTML requires some effort, basic knowledge of OPL and knowledge of HTML (and any other desired output formats). However, the result is a far more flexible than other HTML generation tools for the EPOC platform and it is easier than editing all your complex but repetitive HTML tagging by hand.
You might say that Cascading Style Sheets (CSS) are the best way to control the presentation of HTML documents - and you'd be right! So, if all the presentation information is in the CSS then why do you need a tool to help write the HTML?
A tool like FlexHTML is a compliment and not a competitor to CSS.
To install this software on your machine, just install the main application SIS file:
FlexHTML.sis
The software will be installed on the C: drive, only:
You can test the FlexHTML installation by running the C:\FlexHTML\Runme.opo example file. See below for more details.
Note: Please consult the manuals for your device for details of installing applications packaged in SIS files. You will require a PC or Mac running your EPOC connect software (i.e. PsiWin 2 or equivalent) or the "Add/Remove" icon on the control panel of your EPOC device. Double-clicking on the SIS file either on the EPOC device or on the PC/Mac connected to the EPOC device should do the trick.
A FlexHTML template consists of an OPL procedure which is invoked when the FlexHTML processor finds a template invocation in the source file it is processing. The OPL function is responsible for generating any output that will replace the template call in the output file, accessing any global state variables it may require.
Consider the following simple example:
proc hello$: lprint "Hello ";flexGetArg$:(1);"!" endp
This template, hello, writes a single line to the output stream; a greeting to the person named by the templates first argument.
To invoke the template, one would include something like the following in the input file:
##+hello World ##-
This would be replaced in the output, by:
Hello World!
That's pretty much it! Simple but effective, as we shall see...
In order to use FlexHTML you will need the following:
Mix as follows:
If all goes well, an HTML version of the document will have been generated.
The remaining sections of this manual show how it all works. Look at the Runme.opl and Readme.flx files to get some ideas about what you can do.
Note: My use of the ".flx" extension is arbitrary. You may use any file name extension that you wish (e.g. ".txt" or none)
The input to FlexHTML must either be a ASCII text file or an OPL Program source file. In the case of the latter, we're simply misusing the OPL editor as a convenient text editor; removing the requirement for you to export from Word or Program as plain text, or find another text editor.
The input file contains a mixture of text to be copied to the output file and template invocations. When the file is processed, the simple input is copied to the output (unchanged, unless an encoding table is selected) but any template invocations are replaced with their output.
Note: If you wish, the input file may consist entirely of templates. All that would remain of the input file in the output stream would be any blank lines you left between the templates.
Note: You can also use FlexHTML to export OPL Program files to plain text in batches. If the Program file contains no templates the the output will be a simple plain text version of the input.
FlexHTML uses a simple syntax for templates. Any line starting with '##' (i.e. no preceding white space) is a control line, and anything else is pretty much ignored.
The character immediately following the '##' indicates the type of control line.
Template control characters | |
---|---|
+ |
##+hello Begin a new template argument. If this the first argument of the template, then the template name follows the '+'. |
- |
##- End the last argument of the template. |
! |
##!footer Call template without providing arguments (i.e. a short-hand for '##+footer' followed by '##-'). |
; |
##; Comment text A comment line - the remaining text on the line is ignored and no output is generated. You can also use the ";" character to insert a comment at the end of a control line (e.g. "##+hello ;say hello"). |
The main procedure of the control program is responsible for:
The following functions are provided by FlexHTML.opo for this purpose.
Functions for use in control procedure | |
---|---|
flexVerChk: |
flexVerChk:(kFlexVersion) Ensure loaded FlexHTML OPM is compatible with the version required (i.e. the version of the header against which the user-written code has been translated). The constant, kFlexVersion, is provided for this purpose. The function only returns if the OPM is compatible. Otherwise, an error is reported and execution is terminated. |
flex: |
flex:("c:\example.flx", "c:\", "example.htm", kFlexFlags_None&) Process named file to produce named output on named output path. See below for more information about the arguments to this function. |
Note: My use of the ".flx" extension is arbitrary. You may use any file name extension that you wish (e.g. ".txt" or none)
The flex: function is used in the control procedure to direct the generation of one output file. The function has four parameters, as outlined below.
Parameters to flex: function | |
---|---|
inputSpec$ |
"c:\example.flx" Normally, this is absolute path of the input file containing the source for this output. Alternatively, this input specification may be the name of a template, prefixed by "##!", which will be called with empty arguments. For example, the input specification "##!doall" would be equivalent to an input file containing the single line, "##!doall". |
outputPath$ |
"c:\" The absolute path of the folder in which the output files are to be generated. If output files are to be generated in subdirectories, this is the top directory of the output. |
outputFile$ |
"example.htm" The name of the output file, relative to the output path. You may include a folder name if the output file is in a subdirectory (using the "\" separator). The value of this parameter can be retrieved within a template implementation, using the flexOutFile$: function. |
flags& |
kFlexFlags_None& The flags& parameter modifies the behaviour of the flex: processing. Constants for the following flags are included in FlexHTML.oph and they may be ORed together in multiple options are required.
|
Note: My use of the ".flx" extension is arbitrary. You may use any file name extension that you wish (e.g. ".txt" or none)
For each template used in the source file, you must provide an OPL procedure for the template. The name of the procedure must be the template name with a '$' suffix (i.e. return a string) and it must have no arguments.
Note: Please do not start template names with the letters 'flex'.
To generate the template's output, simply LPRINT whatever you want. Your LPRINTed text will appear in the output stream where the template invocation appeared in the input stream.
The return string of a template is any error message. If the template is sucessful, you should return an empty string. If a non-empty error message is returned, FlexHTML will display an error report including your message.
Note: You can pass information between templates (e.g. section counters) via OPL global variables, which must be declared by your control program and which must not start with the letters 'flex'.
Templates are most useful when they are given arguments. Templates may have up to 8 (kMaxArgs%) arguments of up to 8192 (kMaxArgLength%) characters each. The constants for these values are provided in FlexHTML.oph. Any arguments not supplied in the template invocation in the source file will be empty (i.e. have zero length).
Arguments are numbered from 1 to 8 and can be retrieved by the following functions.
Functions to read template arguments | |
---|---|
flexArgLen%: |
flexArgLen%:(arg%) Returns the length of the numbered argument. |
flexGetArg$: |
flexGetArg$:(arg%) Returns the contents of the numbered argument, as a string. The argument must be no more than 255 characters in length, in order to fit into an OPL string. |
flexInsertArg: |
flexInsertArg:(arg%) Copy the numbered argument into the output stream, with no changes. The argument may be of any length (up to the maximum length of 8192 characters) as it does not have to be stored in an OPL string. |
flexInsertEncodedArg: |
flexInsertEncodedArg:(arg%,table$) Copy the numbered argument into the output stream, using the named text encoding table. The argument may be of any length (up to the maximum length of 8192 characters) as it does not have to be stored in an OPL string. |
Note: With the exception of "flexInsertEncodedArg:", all these argument retrieval functions return the values exactly as specified in the template invocation, with no text encoding table applied.
FlexHTML includes the ability to combine multiple source files to form a single output, thus enabling common features such as scripts and navigation areas to be maintained from a single source and embedded on every page.
The processing of embedded inputs is truly recursive; templates in the embedded source will be processed and may embed still further sources, as required.
Function to embed other files | |
---|---|
flexInclude: |
flexInclude:(includeFileName$) Process named file and insert output into current output stream. |
Note: If you want to declare a global variable to be available for the processing of the single embedded source, declare the global in the OPL procedure that calls the flexInclude: function.
Note: All text encoding table settings active at the point of the include will be inherited by the included file. In addition, any changes to these settings made during the processing of the file will persist and be applied to the remainder of the original file, following the include.
In addition to the basic functions for processing files and handling template arguments, FlexHTML provides a number of utility functions. These are summarised, below.
Auxillary functions | |
---|---|
flexVer$: |
flexVer$: Returns a version string identifing FlexHTML, suitable for inclusion in an HTTP GENERATOR header. |
flexInsertBoilerplate: |
flexInsertBoilerplate:("") Inserts a standard "made with FlexHTML"-style string into the output stream. If you use FlexHTML, please consider using function as part of your document footer. The argument string to this function is reserved for future use and must be empty for now. |
flexOutFile$: |
flexOutFile$: Returns the name of the current output file, relative to the top level output directory (as specified in the flex: function). This can be useful to generate correct include document URLs in footers, for example. The file name is returned using the EPOC conventions but can be converted to URL format using an HTTP text encoding table. |
flexKeyword$: |
flexKeyword$:(string$,allowEmpty%) Analyse supplied string (e.g. a template argument that represents a flag or option) to find a keyword, consisting of alphanumeric and '-' characters. Leading and trailing spaces are removed but other spaces will raise an error. Result is always returned in upper case. |
flexError: |
flexError:(errorCode%,errorMessage$) Halt document processing with given OPL error code and message. If error code is 0 then no action is taken, allowing this function to be called with an I/O response code without testing for a non-zero value first |
See below for a complete listing of FlexHTML.oph with more details of these functions.
The manual yor are reading is an example applicatiion of FlexHTML. Take a look at the supplied Runme.opl and Readme.flx files that are used to generate it. For example, see how:
The text encoding functions allow plain text to be transformed onto a form suitable for a particular output format, ensuring that any special characters are encoded (or "escaped") correctly. This technique is used to encode the source files embedded at the end of this manual.
For example, the string "Black & white" might be encoded to "Black & white" for HTML output. This can be used to transform the arguments of templates, data extracted from databases or even whole texts without having to examine their content.
Another way to use the text encoding functionality is to convert EPOC file names into HTTP URLs. In this case, spaces become the "+" character and other characters may be escaped to hexadecimal codes. For convenience, the EPOC directory separator, "\" might be replaced with the URL one, "/".
The FlexHTML text encoding functions are based on tables, a set of which are loaded from a single table file. Each time an encoding function is used, the name of the required table is supplied as a function parameter.
There are two encoding tables supplied, as summarised in the following table. You can also write your own encoding table files, allowing you to customise the encoding to your needs.
Supplied text encoding tables | |
---|---|
HTTP |
kEncodeTable_HTTP$ Converts a string to a form suitable for inclusing in an HTTP URL. Also replaces the "\" character with "/", for EPOC to URL directory path conversion. Allows alphanumerics, full-stops (".") and underscores ("_") to pass through, unaltered. Spaces become a plus sign ("+") and the remaining characters are escaped by a percent ("%") character followed by two hexadecimal digits. |
HTML |
kEncodeTable_HTML$ Encodes plain text into a form suitable for inclusion in an HTML document, with special characters (e.g. "<") correctly encoded so they are not interpretted as tags by the browser. Also encodes accented characters and the non-break space character (code 160), using the appropriate tag names. This assumes that the input is in the standard "1252, ISO Latin-1" character set used by most EPOC machines. |
No encoding |
kEncodeTable_None$ Not strictly an encoding table, but all encoding functions understand an empty encoding table name to mean no encoding. Encoding is turned off for the operation and all characters pass unaltered. |
Text encoding can be applied within your template implementations through the use of the following functions. Each function requires that you specify a valid encoding table name. Constants for the names of the supplied text encodings are included in the header file, and summarised in the previous section.
Text encoding functions | |
---|---|
flexEncode$: |
flexEncode$:(string$,table$) Returns the value of an arbitrary string encoded by the named encoding table. The encoded string may be of different length to the original but an error will occur if the result is longer than 255 characters. |
flexInsertEncodedString: |
flexInsertEncodedString:(string$,table$) Sends the value of an arbitrary string encoded by the named encoding table to the output. The encoded string may be of different length to the original and it does not matter if the result is longer than 255 characters. |
flexInsertEncodedArg: |
flexInsertEncodedArg:(a%,table$) Sends the value of the specified template argument encoded by the named encoding table to the output. The encoded text may be of different length to the original and it does not matter if the result is longer than 255 characters. |
flexSetBaseTextEncoding$: |
flexSetBaseTextEncoding$:(table$) Sets an encoding table to be used for the text copied directly from the input to output streams; i.e. text that appears outside of template invocations. This can be used to embed whole passages of text (such as segments of source code) without having to consider whether it contains special characters. The function returns the name of the base encoding in use before the function was called, to allow templates to choose a temporary encoding by saving and later restoring the current one. At the start of processing, no base encoding table is in use. To turn the base text encoding off again, specify an empty table name, using the constant kEncodeTable_None$. Note that this setting has no effect on the values of template arguments; templates access them as they appear in the input stream but can encode them as required using the other text encoding functions. |
Whilst the supplied text encoding tables may be sufficient for many purposes, they can be modified to suit other needs.
Text encoding table files are text files that describe up to four independent encodings. FlexHTML can only load one encoding table file at a time, but the current encoding table file can be changed dynamically, using the flexSetEncodingTableFile$: function.
Functions to control the text encoding tables | |
---|---|
flexSetEncodingTableFile$: |
flexSetEncodingTableFile$:(file$) Sets the current text encoding table file to the named file, which will be loaded when the next text encoding operation is performed. The function returns the name of the file in use before the function was called, to allow templates to choose a temporary file by saving and later restoring the current one. All other text encoding settings are cleared. |
Note: Changing the current text encoding file causes FlexHTML to clear all current text encoding settings. Any base text encoding is turned off. Frequent changes of the text encoding file will slow performance as it is reloaded each time.
The format of the text encoding file is fairly straightforward. You can use the supplied default text encoding table as a starting point. The file can contain up to four encoding tables, each of which are formatted as follows.
Most text-based formats and languages can be contained in the input stream provided that they do not require the use of '##' as the first two characters on a line. However, since FlexHTML replaces blocks of lines with other blocks of lines, it is not possible to insert variables in the middle of a line (as the C macro pre-processor does, for example).
FlexHTML currently knows nothing (or at least very little) of the data it is handling. This may be a concern if you wish to both target an output stream that can handle word-wrapping (e.g. HTML) and one that cannot (e.g. plain text).
Another problem with generating multiple output formats lies in the conventions for escape character sequence. For example, if I write '&', this would appear as an ampersand character in formatted HTML/XML/etc, but would appear as the raw escape sequence in a text output.
The text encoding feature, introduced in Version 1.2, can be used to handle this problem. However, care must still be taken to use the correct text encoding at the correct point in your OPL code.
If you have any problems, comments or suggestions about this software, you can contact me at the following email addresses:
This application is distributed in association with FreEPOC:
For the latest news of this an my other software, also visit:
rem ==================================================== rem = FlexHTML.oph - FlexHTML OPM header file rem = (C) 2000, 2001 David Rushall rem = In association with FreEPOC rem = All rights reserved. rem = See associated documentation for details of use rem = -------------------------------------------------- rem = Please consider using standard FlexHTML footer rem = 'boilerplate' on public HTML pages generated with rem = this OPM. See "flexInsertBoilerplate:" below. rem = -------------------------------------------------- rem = Free your plamtop... Free yourself... FreEPOC rem = Web http://www.freepoc.org/ rem = Email dave@freepoc.org rem = -------------------------------------------------- rem = Dave Rushall http://www.piecafe.demon.co.uk/ rem ==================================================== rem ---------------------------------------------------- rem - Constants rem - const kMaxArgs%=8 : rem number of template args const kMaxArgLength%=8192 : rem template argument length const kMaxLineLength%=255 : rem input line length const kFlexVersion=1.2 : rem FlexHTML version number const kFlexHTMLUID&=&10003934 : rem ...and UID rem - Supplied text encoding tables const kDefaultEncodingFilename$="C:\System\OPM\FlexHTML.tab" const kEncodeTable_None$="" : rem no encoding const kEncodeTable_HTML$="HTML" : rem for HTML (Latin) const kEncodeTable_HTTP$="HTTP" : rem for HTTP URLs (Latin) rem - Flags for flex:() calls const kFlexFlags_None&=&00 : rem standard operation const kFlexFlags_SourceNewer&=&01 : rem skip old sources rem (other flags reseved for future use) rem ---------------------------------------------------- rem - flexVerChk - Version check rem - Args: version, header version identifier rem - Return: Nothing rem - Notes: Confirms FlexHTML OPM is compatible with rem - supplied FlexHTML version number. rem - Completes only if compatible (else STOPs) rem - Use in main code body thus... rem - flexVerChk:(kFlexVersion) rem - May be called at any time external flexVerChk:(version) rem ---------------------------------------------------- rem - flex - do template processing for a single input rem - Args: inFile$, input file name (inc path) rem - or single template name rem - outPath$, local output file directory rem - outFile$, output file name rem - flags&, proceessing flags rem - Return: Nothing rem - Notes: Opens input and output files and copies rem - input to output, line by line. If a rem - template sequence is encountered, the rem - arguments are collected (with nothing rem - written to output) and the user template rem - function called. The template function rem - is then free to make calls to other rem - library functions and generates required rem - output via LPRINT statements. rem - Input file may be either plain text file rem - or produced with the OPL program editor. rem - Alternatively, input may be a template rem - name, prefixed by "##!", in which case rem - the output is the result of the single rem - template invocation (without arguments). rem - Output is plain text file. rem - See constants above for valid flags. rem - Completes only if succesful (i.e. no rem - errors were detected or raised by user rem - templates) rem - May NOT be called within a user template rem - external flex:(inFile$,outPath$,outFile$,flags&) rem ---------------------------------------------------- rem - flexInclude - embed another input in output rem - Args: inFile$, input file name (inc path) rem - Return: Nothing rem - Notes: Input file may be either plain text file rem - or produced with the OPL program editor, rem - and may include templates for processing. rem - Completes only if succesful (i.e. no rem - errors were detected or raised by user rem - templates) rem - May ONLY be called within a user template rem - external flexInclude:(inFile$) rem ---------------------------------------------------- rem - flexVer$ - return FlexHTML version string rem - Args: None rem - Return: Version string rem - Notes: Output suitable for HTTP 'GENERATOR' rem - header, etc. rem - May ONLY be called within a user template rem - external flexVer$: rem ---------------------------------------------------- rem - flexArgLen% - get template argument length rem - Args: a%, argument number rem - Return: Argument length rem - Notes: Length of indicated template argument rem - is returned rem - Argument is counted unmodified; no rem - text encoding table will be applied. rem - May ONLY be called within a user template rem - external flexArgLen%:(a%) rem ---------------------------------------------------- rem - flexGetArg$ - get template argument as string rem - Args: a%, argument number rem - Return: Argument sting rem - Notes: Contents of indicated template argument rem - is returned as a string. If argument is rem - longer than 255 and processing is rem - terminated. rem - Argument is returned unmodified; no rem - text encoding table will be applied. rem - May ONLY be called within a user template rem - external flexGetArg$:(a%) rem ---------------------------------------------------- rem - flexInsertArg - send template argument to output rem - Args: a%, argument number rem - Return: Nothing rem - Notes: Contents of indicated template argument rem - is placed into output stream. Argument rem - may be of any length (up to maximum). rem - Argument is output unmodified; no rem - text encoding table will be applied. rem - May ONLY be called within a user template rem - external flexInsertArg:(a%) rem ---------------------------------------------------- rem - flexInsertEncodedArg - output encoded argument rem - Args: a%, argument number rem - table$, text encoding table name rem - Return: Nothing rem - Notes: Behaves as flexInsertArg: except the rem - argument is encoded using the named rem - text encoding table, when placed into rem - the output stream. Argument may be of rem - any length (up to maximum). rem - If the table name is the empty string, rem - no encoding will be used. rem - See constants above for supplied tables. rem - May ONLY be called within a user template rem - external flexInsertEncodedArg:(a%,table$) rem ---------------------------------------------------- rem - flexEncode$ - encode string using encoding table rem - Args: string$, string to be encoded rem - table$, text encoding table name rem - Return: String encoded by named encoding table. rem - Notes: Encodes any string using text encoding rem - table. rem - Encoded output may be longer then the rem - original. An error will be raised if the rem - result is longer than 255 characters. rem - If the table name is the empty string, rem - no encoding will be used. rem - See constants above for supplied tables. rem - May ONLY be called within a user template rem - external flexEncode$:(string$,table$) rem ---------------------------------------------------- rem - flexInsertEncodedString - output encoded string rem - Args: string$, string to be encoded to output rem - table$, text encoding table name rem - Return: Nothing rem - Notes: Send any string to ouput, after applying rem - named text encoding table. rem - Encoded output may be longer then the rem - original but it does not matter if the rem - result is longer than 255 characters. rem - If the table name is the empty string, rem - no encoding will be used. rem - See constants above for supplied tables. rem - May ONLY be called within a user template rem - external flexInsertEncodedString:(string$,table$) rem ---------------------------------------------------- rem - flexSetBaseTextEncoding$ - set encoding for base rem - Args: table$, text encoding table name rem - Return: Name of previously used base encoding. rem - Notes: Sets the encoding table to be used for rem - text copied directly from the input to rem - output streams; i.e. text that appears rem - outside of template invocations. rem - This setting has no effect on the values rem - of template arguments or text generated rem - by templates. rem - If the table name is the empty string, rem - or this function is never used, no base rem - encoding will be used. This is the rem - default. rem - See constants above for supplied tables. rem - May ONLY be called within a user template rem - external flexSetBaseTextEncoding$:(table$) rem ---------------------------------------------------- rem - flexSetEncodingTableFile$ - set user encoding file rem - Args: file$, name of new encoding table file rem - Return: Name of previously used table file. rem - Notes: Selects user encoding table file, to be rem - used insead of the one supplied by rem - FlexHTML. All existing text encoding rem - table settings are cleared. rem - If not used, text encoding operations rem - will use the default supplied encoding rem - tables. rem - File must be a valid FlexHTML encoding rem - table file. rem - May ONLY be called within a user template rem - external flexSetEncodingTableFile$:(file$) rem ---------------------------------------------------- rem - flexInsertBoilerplate - FlexHTML footer to output rem - Args: empty$, reserved (must be "" for now) rem - Return: Nothing rem - Notes: Standard FlexHTML HTML footer insert rem - is placed into output stream. rem - Reserved parameter, empty$, MUSt be "" rem - May ONLY be called within a user template rem - rem - Please consider using this footer at rem - the end of all public HTML documents rem - generated with the help of FlexHTML. rem - external flexInsertBoilerplate:(empty$) rem ---------------------------------------------------- rem - flexOutFile$ - returns name of current output file rem - Args: None rem - Return: Value of outFile$ specified on flex: call rem - Notes: Name is retuned in EPOC format (can be rem - converted to URL format using a text rem - encoding table). rem - May ONLY be called within a user template rem - external flexOutFile$: rem ---------------------------------------------------- rem - flexKeyword$ - extract keyword from string rem - Args: s$, string in which to look rem - allowNull%, if zero an error is raised if rem - no keyword was found in string rem - Return: Value of keyword, in upper case rem - Notes: Given a string, this function trims all rem - leading and trailing white space and rem - returns the remainder, folded to upper rem - case. rem - If the remainder contains any characters rem - other than 'A' to 'Z', '0' to '9' or '-' rem - then an error is raised and the function rem - does not return. rem - An error is also raised if the remainder rem - is the empty string and allowNull% is rem - false. rem - May ONLY be called within a user template rem - external flexKeyword$:(s$,allowNull%) rem ---------------------------------------------------- rem - flexError - test for and report error rem - Args: ec%, standard OPL error code rem - msg$, error message string rem - Return: Nothing rem - Notes: If ec% is non zero, an error report is rem - generated (including line number, error rem - description and supplied message text) rem - and processing is terminated. rem - Returns immediately if ec% is zero. rem - May ONLY be called within a user template rem - external flexError:(ec%,msg$) rem ==================================================== rem End of FlexHTML.oph rem ====================================================
; ==================================================== ; = FlexHTML.tab - FlexHTML OPM escaping table ; = (C) 2000, 2001 David Rushall ; = In association with FreEPOC ; = All rights reserved. ; = See associated documentation for details of use ; = -------------------------------------------------- ; = Please consider using standard FlexHTML footer ; = 'boilerplate' on public HTML pages generated with ; = this OPM. See "flexInsertBoilerplate:" in header. ; = -------------------------------------------------- ; = Free your plamtop... Free yourself... FreEPOC ; = Web http://www.freepoc.org/ ; = Email dave@freepoc.org ; = -------------------------------------------------- ; = Dave Rushall http://www.piecafe.demon.co.uk/ ; ==================================================== ; ---------------------------------------------------- ; Table for HTTP URL escaping ; ---------------------------------------------------- HTTP %FF ; Suppress control characters... $00 $1F \ ; Space becomes a "+"... $20 > + ; EPOC directory separators to URL ones... %\ > / ; Allow other typical filename characters... %0 %9 = %A %Z = %a %z = %. = %_ = ; Remaining characters numerically escaped ; End of HTTP table ; ---------------------------------------------------- ; ---------------------------------------------------- ; Table for "1252, ISO Latin-1" language HTML escaping ; ---------------------------------------------------- HTML ϧ ; Suppress control chars... $00 $1F \ $7F \ ; ...except for white space... $09 $0A = $0D = ; Allow remaining 7-bit characters... $20 $7E = ; ...except for special HTML characters... %" > " %& > & %< > < %> > > ; ISO 8859-1 characters (codes 160-255)... $A0 > %¡ > ¡ %¢ > ¢ %£ > £ %¤ > ¤ %¥ > ¥ %¦ > ¦ %§ > § %¨ > ¨ %© > © %ª > ª %« > « %¬ > ¬ % > ­ %® > ® %¯ > ¯ %° > ° %± > ± %² > ² %³ > ³ %´ > ´ %µ > µ %¶ > ¶ %· > · %¸ > ¸ %¹ > ¹ %º > º %» > » %¼ > ¼ %½ > ½ %¾ > ¾ %¿ > ¿ %À > À %Á > Á % >  %à > à %Ä > Ä %Å > Å %Æ > Æ %Ç > Ç %È > È %É > É %Ê > Ê %Ë > Ë %Ì > Ì %Í > Í %Î > Î %Ï > Ï %Ð > Ð %Ñ > Ñ %Ò > Ò %Ó > Ó %Ô > Ô %Õ > Õ %Ö > Ö %× > × %Ø > Ø %Ù > Ù %Ú > Ú %Û > Û %Ü > Ü %Ý > Ý %Þ > Þ %ß > ß %à > à %á > á %â > â %ã > ã %ä > ä %å > å %æ > æ %ç > ç %è > è %é > é %ê > ê %ë > ë %ì > ì %í > í %î > î %ï > ï %ð > ð %ñ > ñ %ò > ò %ó > ó %ô > ô %õ > õ %ö > ö %÷ > ÷ %ø > ø %ù > ù %ú > ú %û > û %ü > ü %ý > ý %þ > þ %ÿ > ÿ ; Remaining CP-1252 chars (codes 128-159)... %€ > € $81 \ %‚ > ‚ %ƒ > ƒ %„ > „ %… > … %† > † %‡ > ‡ %ˆ > ˆ %‰ > ‰ %Š > Š %‹ > ‹ %Œ > Œ $8D $90 \ %‘ > ‘ %’ > ’ %“ > “ %” > ” %• > • %– > – %— > — %˜ > ˜ %™ > ™ %š > š %› > › %œ > œ $9D $9E \ %Ÿ > Ÿ ; End of HTML table ; ----------------------------------------------------
Generated with help from FlexHTML for EPOC