Dear Barry and Marwen, 

Yes, we used the encoding as in here (https://github.com/moses-
smt/mosesdecoder/blob/master/contrib/server/client.perl) .

But seems that we didn't succeed, so we have used more of less Marwen version 
but changing a little bit the code (our solution is quite different, but 
essencially.. the result is more or less this):

#!/usr/bin/perl
# Perl sample client for mosesserver (Created by Marwen AZOUZI)

use strict;
#use Data::Dumper;
use RPC::XML;
use RPC::XML::Client;
use Encode;

my $text = $ARGV[0];

my $client = RPC::XML::Client->new('http://127.0.0.1:8000/RPC2');
$RPC::XML::ENCODING = "UTF-8";
my $request = RPC::XML::request->new('translate',RPC::XML::struct->new({'text' 
=> RPC::XML::string->new(Encode::encode("utf8",$text))}));
my $response = $client->send_request($request);

if (!$response) {
        print $RPC::XML::ERROR, "\n";
} else {
        print $response->{text}->value;
}

Thank you very much for your help!
Bests, 
Montse

_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to