����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /home/real/node-v13.0.1/test/addons/parse-encoding/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/real/node-v13.0.1/test/addons/parse-encoding/binding.cc
#include <node.h>
#include <v8.h>

namespace {

#define ENCODING_MAP(V) \
  V(ASCII)              \
  V(BASE64)             \
  V(BUFFER)             \
  V(HEX)                \
  V(LATIN1)             \
  V(UCS2)               \
  V(UTF8)               \

static_assert(node::BINARY == node::LATIN1, "BINARY == LATIN1");

void ParseEncoding(const v8::FunctionCallbackInfo<v8::Value>& args) {
  const node::encoding encoding =
      node::ParseEncoding(args.GetIsolate(), args[0],
                          static_cast<node::encoding>(-1));
  const char* encoding_name = "UNKNOWN";
#define V(name) if (encoding == node::name) encoding_name = #name;
  ENCODING_MAP(V)
#undef V
  auto encoding_string =
      v8::String::NewFromUtf8(args.GetIsolate(), encoding_name,
                              v8::NewStringType::kNormal)
      .ToLocalChecked();
  args.GetReturnValue().Set(encoding_string);
}

void Initialize(v8::Local<v8::Object> exports) {
  NODE_SET_METHOD(exports, "parseEncoding", ParseEncoding);
}

}  // anonymous namespace

NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)

ZeroDay Forums Mini