Reputation: 23317
If one wanted to add a new char encoding to 1.9.x, supported just the same as the built-in encodings, how would you go about doing it? Can you do it with code in ruby, or would it require a C patch in MRI?
(I don't think it matters, but I am interested in the Marc8 encoding, an old legacy encoding still in use in library (like the kind with books) systems and records.)
Upvotes: 5
Views: 106
Reputation:
I'd recommend looking at how it is implemented in Ruby 1.9.2. Basically dig into the source code and... :-)
This is a similar question: Create own encoding
some good articles on encodings:
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
Upvotes: 2