Encoding 0 length data, returns '' instead of null

This commit is contained in:
Ryan Dahl
2010-02-22 12:07:07 -08:00
parent b8dee2eb20
commit 46ebaa00ce
2 changed files with 4 additions and 2 deletions

View File

@@ -170,7 +170,7 @@ enum encoding ParseEncoding(Handle<Value> encoding_v, enum encoding _default) {
Local<Value> Encode(const void *buf, size_t len, enum encoding encoding) {
HandleScope scope;
if (!len) return scope.Close(Null());
if (!len) return scope.Close(String::Empty());
if (encoding == BINARY) {
const unsigned char *cbuf = static_cast<const unsigned char*>(buf);