thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Hesp <tom.h...@saasplaza.com>
Subject Diacritics get garbled when sent from Perl client.
Date Tue, 20 Jan 2015 09:19:07 GMT
Hi,

This question may have been asked before on this list but I have not 
been able to find anything about it.

I am using Thrift version 0.9.1 and have a C++ Thrift server maintaining 
user records in a database.
When I send user information containing diacritics (like á, ö, è, etc.) 
to it from a C++ or PHP client everything is fine.
However, when I do the same from a Perl client, the diacritics become 
garbled. The example characters above are received by the server as 
something like this: áöè

I am using the BinaryProtocol so I checked the BinaryProtocol.pm and saw 
the following construct in writeString:
     if( utf8::is_utf8($value) ){
         $value = Encode::encode_utf8($value);
     }
Which means that the string is encoded to Perl's internal format.

I also checked the C++ libraries at the receiving (server) end but I do 
not see the string being decoded again!
I even tried this with a little Perl server but the results are the 
same, the data gets encoded but is never decoded.

Am I missing something? Do I need to define something in the IDL so the 
server knows it may have to decode the string?

Thanks for your time.

Kind regards,
Tom Hesp
-- 

Mime
View raw message