Hi,

On Thu, Nov 17, 2016 at 01:34:30PM +1300, Samuel Williams 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.

It is not possible in Ruby code, but since each of the existing
encodings is defined by separate C source files in the MRI source, you
could try having a look at them and how they do it. They're all in the
enc/ folder: https://github.com/ruby/ruby/tree/trunk/enc

I would thus expect that it is possible to add new encodings using a C
extension.

Greetings
Marvin

-- 
Blog: http://www.guelkerdev.de
PGP/GPG ID: F1D8799FBCC8BC4F

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