tags:

views:

105

answers:

2

How can i create my own encoding in ruby(1.9)? - for converting string while reading/writing from/for a file, i.e. generally for manipulating data in nonstandard encoded strings (http://en.wikipedia.org/wiki/Mazovia_encoding)

+1  A: 

To your updated question: At the moment all you can do is write some custom code which handles file reading/writing at byte level and does the needed conversions.


If you refer to how you can use different character encodings in ruby with version 1.9 I point you to

Working with Encodings in Ruby 1.9 and

Understanding M17n

jitter
he ment implementing an Encoding instance for an Encoding that is unsupported by default on ruby
SztupY
a changed his question
jitter
+1  A: 

I couldn't find any references in the ruby-docs about using proprietary encodings, and the Encoding class doesn't have any initializers (but Encoding.find() can load some of the encodings IConv supports dinamically) Unfortunately afaik Mazovia is unsupported even in iconv, so you're stuck with implementing your own class...

SztupY