Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1679

NodeJS: protocol readString() should treat string as utf8, not binary

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Implemented
    • 0.8
    • 0.9
    • Node.js - Library
    • None
    • All

    Description

      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"

      Attachments

        Activity

          People

            Unassigned Unassigned
            mikefleming Michael Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: