JavaScript Teletext coder/encoder