5

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.)

jrochkind
  • 22,799
  • 12
  • 59
  • 74

1 Answers1

2

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

Community
  • 1
  • 1
  • thanks. I have gotten confused trying to find it looking around the source code, was hoping someone could direct me to what files to look at, or provide an overview, or even just say if it's implemented in C or ruby in the source code. – jrochkind Nov 17 '11 at 14:05