-
Notifications
You must be signed in to change notification settings - Fork 20
BUG:can't search utf8 string ( and can't display correct utf8 encoding result) #3
Description
When i query '测试' or other string。。。example: 'ふじこ' 。。node-sphinxapi display some error.Whether it not support the search for utf8 encoding string
btw: it do not display correctly results ( utf8 encoding)
the code 1:
var SphinxClient = require ("./node-sphinxapi/lib/sphinxapi.js"),
assert = require('assert');
var cl = new SphinxClient();
cl.SetServer('127.0.0.1', 9312);
cl.Query('忍者', 'xml', function(err, res) {
console.log(err, res);
});
I put 'console' in sphinxapi.js (line: 456)
console.log(err).
console.log(response).
console.log(response.toString('utf8')).
the result is:
[Error: searchd error: invalid weight count -1914142587 (should be in 0..256 range)]
null
e:\node-sphinxapi\lib\sphinxapi.js:459
var max_ = response.length
^
TypeError: Cannot read property 'length' of null
at E:\project\root\apps\app\minefield\gl\node-sphinxapi\lib\sphinxapi.js:459:22
at Socket.<anonymous> (E:\project\root\apps\app\minefield\gl\node-sphinxapi\lib\sphinxapi.js:183:7)
at Socket.emit (events.js:67:17)
at TCP.onread (net.js:377:14)
the code 2:
var SphinxClient = require ("./node-sphinxapi/lib/sphinxapi.js"),
assert = require('assert');
var cl = new SphinxClient();
cl.SetServer('127.0.0.1', 9312);
cl.Query('loli', 'xml', function(err, res) {
console.log(err, res);
});
result is :
null [ { error: '',
warning: '',
status: [ 0 ],
fields: [ 'name' ],
attrs: [ [Object], [Object] ],
matches: [ [Object] ],
total: 1,
total_found: 1,
time: 0.001,
words: [ [Object] ] } ]
I put 'console' in sphinxapi.js (line: 456)
console.log(err).
console.log(response).
console.log(response.toString('utf8')).
its display some data like:
null
<Buffer 00 00 00 00 00 00 00 01 00 00 00 04 6e 61 6d 65 00 00 00 02 00 00 ...>
loli忍者 .......