You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Ihor Mysak (JIRA)" <ji...@apache.org> on 2013/05/07 22:23:15 UTC
[jira] [Commented] (THRIFT-1679) NodeJS: protocol readString()
should treat string as utf8, not binary
[ https://issues.apache.org/jira/browse/THRIFT-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13651256#comment-13651256 ]
Ihor Mysak commented on THRIFT-1679:
------------------------------------
I guess you can get sources fron this https://github.com/bancek/node-thrift-utf8/blob/master/index.js
> NodeJS: protocol readString() should treat string as utf8, not binary
> ---------------------------------------------------------------------
>
> Key: THRIFT-1679
> URL: https://issues.apache.org/jira/browse/THRIFT-1679
> Project: Thrift
> Issue Type: Bug
> Components: Node.js - Library
> Affects Versions: 0.8
> Environment: All
> Reporter: Michael Fleming
>
> Using Node.js's Thrift library to talk to Hive:
> a) Read back a Hive result that contains utf8 characters
> Expected:
> - Get a Javascript string object that contains the correct utf8 sequence
> Actual:
> - Get a Javascript sequence that is indicative of UTF8 double-encoding
> Underlying:
> In protocol.js, change "readString()"
> var r = this.readBinary().toString('binary');
> to this:
> var r = this.readBinary().toString('utf8');
> Per http://thrift.apache.org/docs/types/
> "string: A text string encoded using UTF-8 encoding"
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira