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

problem with sending request with Cyrillic in UTF-8 from node.js to java.

    XMLWordPrintableJSON

Details

    Description

      Hi guys,
      I used thrift to communicate my services written on java and node.js. (all servers on java, clients on java and on node.js). this bug reproduces just on node.js client.

      In my source I write
      ...
      struct = new appSearch.ttypes.ASearchRequest(params);
      console.log(struct);
      appSearch.client.search(struct, function(err, result) {
      ...

      With latin query all is ok, but with Cyrillic its return an error

      { query: 'ф', tags: null, categoryIds: null, platforms: null, stores: null, ratings: null, price: null, withFacets: true, retrieveCountByTitle: false, withSpellcheck: false, orders: null, offset: 0, size: 10 }

      // this is console.log(struct);

      { name: 'TApplicationException', type: 7, message: 'Required field \'withFacets\' was not found in serialized data! Struct: com.airupt.searcher.thrift.ASearchRequest$ASearchRequestStandardScheme@1140382' }

      // this is console.log(err);

      my ASearchRequest structure
      struct ASearchRequest {
      1:optional string query,
      2:optional set<string> tags,
      3:optional set<i32> categoryIds,
      4:optional set<byte> platforms,
      5:optional set<byte> stores,
      6:optional set<byte> ratings,
      7:optional PriceFilter price,

      8:required bool withFacets,
      9:required bool retrieveCountByTitle,
      10:required bool withSpellcheck,

      11:optional list<ASearchOrder> orders,
      12:required i32 offset,
      13:required i32 size
      }

      As I said follow, with latin in requests all works correct.

      Can any one help me with it ?

      transport: thrift.transport.TBufferedTransport
      protocol: thrift.protocol.TBinaryProtocol

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              imysak Ihor Mysak
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: