joyent/node — Issue #2596: buffer toString('ascii') not working per Docs
Author: trueshot
Created: 2012-01-23 10:59:37+00:00
State: open

(new Buffer("\0")).toString('ascii') == '\u0000'

according to the docs it should be:

(new Buffer("\0")).toString('ascii') == ' '

Per the Docs v0.6.8:
>'ascii' - for 7 bit ASCII data only. This encoding method is very fast, and will strip the high bit if set. Note that this encoding converts a null character ('\0' or '\u0000') into 0x20 (character code of a space). If you want to convert a null character into 0x00, you should use 'utf8'.