I'm trying to get the standard CSV library ready for m17n in Ruby  
1.9.  I'm going to layout my thoughts here and would love to get some  
feedback on these issues.

First, it's important to consider what strategy CSV should use to  
adapt to encodings.  CSV generally reads from IO or String objects.   
Obviously, those could have any number of encodings.  The "parser" is  
just a few regular expressions that break up the input.  I've  
considered:

* Adapt the parser to the encoding of the input.  This is my current  
first choice.  The parser only cares about a few characters, so if I  
transcode those characters into the encoding of the input, my hope is  
that it could be made to process most data.  Obviously, there could be  
issues transcoding certain characters to certain encodings and I would  
probably just default to ASCII-8BIT in that case.

* Have the parser always work in ASCII-8BIT.  I imagine this could  
work for some cases, but I assume it would do bad things to something  
like UTF-16.

* Transcode all incoming data to UTF-8 and work with that.  This is  
probably the easiest to implement, but I would much rather allow users  
to work in their preferred input.

Please let me know if the above logic is faulty.  Assuming I've  
selected the right strategy though, I have another question.

* What is the proper way to build a regular expression in some  
encoding I have in a variable?

I can get the encoding of the data easily enough but what is the  
correct way to translate my UTF-8 source Regexp into that encoding?

Thanks for any advice.

James Edward Gray II