How do I properly create custom text codecs? : <p>I'm digging through some old binaries that contain (among other things) text. Their text frequently uses custom character encodings for Reasons, and I want to be able to read and rewrite them.</p>

<p>It seems to me that the appropriate way to do this is to create a custom codec using the <a href="https://docs.python.org/3.5/library/codecs.html" rel="noreferrer">standard codecs library</a>. Unfortunately its documentation is both colossal and entirely bereft of examples. Google turns up a few, but only for python2, and I'm using 3.</p>

<p>I'm looking for a minimal example of how to use the codecs library to implement a custom character encoding.</p>
