Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space decoded to "null" #15

Closed
iuhh opened this issue Sep 12, 2015 · 1 comment
Closed

Space decoded to "null" #15

iuhh opened this issue Sep 12, 2015 · 1 comment

Comments

@iuhh
Copy link
Contributor

iuhh commented Sep 12, 2015

Hey Michael,

Found the new commit decodes spaces in string to nulls, as it's done char by char this renders the output incorrectly, one would end up with a string "null" in place of " ".

function rChar() {

c58528c@michaelwittigsupport for nulls, infinity and guid
michaelwittig authored 14 days ago
54 var val = rInt8();
55 if (val === 32) {
56 return null;
57 } else {
58 return String.fromCharCode(val);
59 }

Perhaps there was a rationale to add this in earlier? In any case I'd say the old behaviour is correct.

Thanks
Hui

@michaelwittig
Copy link
Owner

Hi Hui,
the emptyChar2null option since v1.0.1 will do what you expect.

var nodeq = require("node-q");
nodeq.connect({host: "localhost", port: 5000, emptyChar2null: false}, function(err, con) {
    if (err) throw err;
    console.log("connected");
    // interact with con like demonstrated below
});

The reason for changing the behaviour in vrsion 1.0.0 is explained here: #13 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants