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
jitter
2009-06-20 22:33:47
he ment implementing an Encoding instance for an Encoding that is unsupported by default on ruby
SztupY
2009-06-21 01:06:25
a changed his question
jitter
2009-06-21 01:57:31
+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
2009-06-21 01:05:27