3 #include <msp/stringcodec/codec.h>
8 int main(int argc, char **argv)
12 cerr<<"Usage: "<<argv[0]<<" <from-enc> <to-enc>\n";
16 StringCodec::Codec *from = StringCodec::create_codec(argv[1]);
17 StringCodec::Codec *to = StringCodec::create_codec(argv[2]);
19 StringCodec::Decoder *from_dec = from->create_decoder();
20 StringCodec::Encoder *to_enc = to->create_encoder();
23 while(getline(cin, line))
26 StringCodec::ustring ustr;
27 from_dec->decode(line, ustr);
29 to_enc->encode(ustr, result);