I am having this error "TextEncoder is not defined" here my code: let json = JSON.stringify({"hello": 55});

const utf8encode= utf8.encode(json);

const messageId = await client.message().index("test").data(utf8encode).submit();

How do I correctly encode the data in utf8?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.