Skip to content

Teletext page hashstring format

Alistair Buxton edited this page Feb 15, 2023 · 8 revisions

The teletext page hashstring format is a method of storing the data for a single teletext page in a URL fragment identifier (the portion of a URL following the hash mark). The parts of the hashstring are delimited by the colon character. The basic format was devised by Simon Rawles for the edit-tf editor and has been implemented for import and export in wxTED and by Alistair Cree in his teletext editor.

Basic format

The first part of the hashstring is a hexadecimal digit, the lower three bits of which represent a character set from the Mullard SAA505x series of character generator ICs. The fourth bit signals that foreground black control codes are to be rendered. Note: the SAA505x character sets DO NOT correspond to teletext page header National Option Character Sub-set bits.

The second part of the hashstring contains the 7-bit character data for 25 visible teletext rows, encoded as 1167 base64 digits using the RFC 4648 URL and Filename Safe Alphabet. After decoding, the 7-bit character code for column c and row r appears at bit positions 280r+7c to 280r+7c+6 inclusive, the most significant bit appearing first. There are therefore two bits at the end of the encoding which are not used. Prior to September 2015 edit-tf supported only the first 24 rows of a page, resulting in 1120 base64 digits.

Extended hashstring format

The extended teletext page hashstring format developed in mid 2017 is a backwards compatible extension to the original edit-tf hashstring, intended as an extensible system for storing additional teletext page data and editor metadata alongside the 25 rows of character data. Additional colon delimited parts are appended to the basic hashstring format. These parts each contain a single key=value pair and may be appended in any order. Support for any key is optional and software manipulating extended hashstrings should locate and modify the values of any keys it implements while leaving the remaining pairs unchanged (though it may change the order in which they are appended to the hashstring). The format of data stored in a key=value pair is specific to each key type, however hexadecimal digits should be uppercase, and text strings should be encoded using RFC 3986 Percent-Encoding. The creation of new key=value pairs should be coordinated between the authors of software implementing this format and the encoding of the values added to this document to avoid key name collisions and promote interoperability.

Key definitions:

PN - Page number

A valid teletext magazine and page number encoded as three hexadecimal digits.

PS - Page status

Teletext page header control bits C4-C14 in hexadecimal. The bit positions are equivalent to those of the Page Status field in the MRG systems TTI format.

RE - Region

Character set "region" corresponding to the high four bits of the Default G0 and G2 Character Set Designation. Encoded as a single hexadecimal digit.

SC - Page subcode

A valid teletext subpage/subcode number in hexadecimal. Leading zeros may be omitted.

X25 - Packet data for row 25

40 7-bit characters encoded as 47 base64 digits in the same manner as the 25 main page rows.

X26 - Local enhancement data and object definitions

Packet X/26 enhancement triplet data as defined in section 12.3 of ETS 300 706. Each 18 bit triplet is encoded as three base64 digits using the RFC 4648 URL and Filename Safe Alphabet. Within each three digits the eighteen bits are arranged with the most significant in the first digit and the least significant in the last. e.g the triplet 0x7829 is encoded Hgp Packet designation codes are omitted and the string need not be padded to a whole multiple of 13 triplets. The string must be a multiple of 3 characters long.

X270 - Editorial linking

Packet X/27/0 data for editorial linking (Fastext) as defined in section 9.6.1 of ETS 300 706. 6 groups of 7 hexadecimal digits for the page number and subcode of a link (MPPSSSS), followed by the link control nibble. Note: the magazine digits here are absolute values 1-8.

X280 - Packet X/28/0 format 1 enhancement data

64 digits representing page specific enhancement data as defined in section 9.4.2 of ETS 300 706. The character set designations are defined in section 15.

Function Encoding
Page function and coding Two hexadecimal digits
Default G0 and G2 Character Set Designation and National Option Selection Two hexadecimal digits
Second G0 Set Designation and National Option Selection Two hexadecimal digits
Left Side Panel 0 or 1
Right Side Panel 0 or 1
Side Panel Status Flag 0 or 1
Number of Columns in Side Panels One hexadecimal digit
Colour Map Entry Coding for CLUTs 2 and 3 Sixteen 12-bit RGB values each encoded as three hexadecimal digits
Default Screen Colour Two hexadecimal digits
Default Row Colour Two hexadecimal digits
Black Background Colour Substitution 0 or 1
Colour Table Re-mapping for use with Spacing Attributes One digit (0 - 7)

The page header control bits C12-C14 in a PS key and character set region in an RE key should be kept synchronised with the value of Default G0 and G2 Character Set Designation and National Option Selection. Software should also set the SAA505x character set bits in the basic hashstring to a relevant value where possible.

The data is only valid when page function and coding values are zero (basic Level 1 Teletext page). It's highly unlikely that a hashstring would or even could be used for other page functions, but the field is included for completeness.

X284 - Packet X/28/4 enhancement data

As X280 but the sixteen 12-bit RGB values apply to CLUTs 0 and 1. CLUT 1 entry 0 is always transparent so the corresponding RGB value should be ignored. If both X280 and X284 are present X280 takes precedence for all but the colour map entry coding.

zx - zxnet editor settings

Reserved for internal use by zxnet.co.uk/teletext/editor.