mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
Clean up outgoing encoding API. Generally: send(chunk, encoding).
This commit is contained in:
1 parent
cf0eebf685
commit
e8f177aa2d
7 files changed
+139
-142
No files matched your search
+19
@@ -243,6 +243,25 @@ node::eio_warmup (void)
|
||||
ev_async_start(EV_DEFAULT_UC_ &eio_watcher);
|
||||
}
|
||||
|
||||
enum encoding
|
||||
node::ParseEncoding (Handle<Value> encoding_v)
|
||||
{
|
||||
HandleScope scope;
|
||||
|
||||
if (!encoding_v->IsString())
|
||||
return RAW;
|
||||
|
||||
String::Utf8Value encoding(encoding_v->ToString());
|
||||
|
||||
if(strcasecmp(*encoding, "utf8") == 0) {
|
||||
return UTF8;
|
||||
} else if (strcasecmp(*encoding, "ascii") == 0) {
|
||||
return ASCII;
|
||||
} else {
|
||||
return RAW;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user