get_decoder Function

Defined in pyglet.text

get_decoder(filename, mimetype=None)

Get a document decoder for the given filename and MIME type.

If mimetype is omitted it is guessed from the filename extension.

The following MIME types are supported:

Plain text
HTML 4 Transitional
Attributed text; see pyglet.text.formats.attributed

DocumentDecodeException is raised if another MIME type is given.

  • filename (str) – Filename to guess the MIME type from. If a MIME type is given, the filename is ignored.
  • mimetype (str) – MIME type to lookup, or None to guess the type from the filename.
Return type:


Previous topic

decode_text Function

Next topic

load Function