I don't think you can create an encoding but you can force a string into an encoding. Idk if there's a functional encoding that exists for what you want but if you can find one:

new_string = old_string.encoding!(<your encoding name>)

- Thomas Perkins

> On Nov 16, 2016, at 6:34 PM, Samuel Williams <space.ship.traveller / gmail.com> wrote:
> 
> I'd like to define an encoding which is a derivative of UTF-8 but
> includes HTML entities.
> 
> Is this possible? I don't see anything like Encoding.new, for example.
> 
> Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>