UTF8 encoding and decoding

Hello team, i hope you are doing well, i am trying to encode a string text that i am receiving from the user so that it gets sent on a json post service to be stored on my data base, i am using the javascript method utf8_encode(), but the console log is showing me that the method doesnt exists. Is there another method to do this?

context.session.BotUserSession.correo = utf8_encode(context.session.BotUserSession.correo);

Additionally, what are the encoding methods usde by default in Kore.

Thanks in advance for your help

@gabriel.garcia

Not all the JS functions would work in a script node on Kore platform. However, there are a few things that can help you.

  1. BotKit, this is a nodejs based SDK, a library which is an extension to the capabilities of Kore bot. You can extend the capabilities / add more modules as you normally do in nodejs program.
    reference:
    https://developer.kore.ai/docs/bots/sdks/installing-the-botkit-sdk/
    https://developer.kore.ai/docs/bots/sdks/using-the-botkit-sdk/
    https://developer.kore.ai/docs/bots/sdks/kore-ai-botkit-sdk-tutorial/
    https://developer.kore.ai/docs/bots/sdks/functions-for-the-botkit-sdk/
    Please look for other community posts for BotKit for more help.

  2. You can also use KoreUtil libraries but there we don’t seem to have any encode function there yet. https://developer.kore.ai/docs/bots/advanced-topics/koreutil-libraries/

  3. You can call a third party external API which can encode and return the encoded string to you in service node.

Thank you for your response, i will try the BotKit solution, just a few questions while i do research on it:
Will it affect reaction times, or any current javascript code that i already have on my bot?
What is the default encoding used by Kore, or does it simply not have internally?