diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index da546b15f264c2..fe70bd91a5234c 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -1411,12 +1411,13 @@ static void Query(const FunctionCallbackInfo& args) { CHECK(args[1]->IsString()); Local req_wrap_obj = args[0].As(); - Local string = args[1].As(); auto wrap = std::make_unique(channel, req_wrap_obj); - node::Utf8Value name(env->isolate(), string); + auto plain_name = + node::Utf8Value(env->isolate(), args[1].As()).ToStringView(); + std::string name = ada::idna::to_ascii(plain_name); channel->ModifyActivityQueryCount(1); - int err = wrap->Send(*name); + int err = wrap->Send(name.data()); if (err) { channel->ModifyActivityQueryCount(-1); } else {