By adding char encoding to ruby ​​1.9.x?

If you need to add a new char encoding in 1.9.x, which is supported in the same way as built-in encodings, how would you do this? Can you do this with a ruby ​​code, or will he need patch C in MRI?

(I don't think it matters, but I'm interested in the Marc8 encoding, an old obsolete encoding that is still used in libraries (like books), systems, and records.)

+5
source share
1 answer

I would recommend to see how it is implemented in Ruby 1.9.2. Basically dig the source code and ... :-)

This is a similar question: Create your own encoding

some good coding articles:

http://yehudakatz.com/2010/05/05/ruby-1-9-encodings-a-primer-and-the-solution-for-rails/

http://blog.grayproductions.net/articles/ruby_19s_string

+2

All Articles