apostrophe is shown as ascii on webchat control

356 views Asked by At

how come the apostrophe always shows up as an ascii on the webchat control? it is properly rendered on the test page of the qnamaker. see attached codes and pictures. this is how i add it on the qna maker knowledge base:

\n\n\t •Please check your computer's power cord. 

QNAMaker Test Page: enter image description here

however when i test it on the webchat control it appears like this.

enter image description here

using asci code instead of the apostrophe also wont fix the problem.

2

There are 2 answers

0
NiteLordz On

I found this problem to happen on macs, not pc. My solution was to add this into my utterance sanitizer that would replace certain characters and therefore allow the Bot to handle it as expected

2
OmG On

If you setup your bot likes the following in web client side:

<!DOCTYPE html>
<html>
  <head>
      <link href="https://unpkg.com/botframework-webchat/botchat.css" rel="stylesheet" />
  </head>
  <body>
    <div id="bot"/>
    <script src="https://unpkg.com/botframework-webchat/botchat.js" </script>
    <script>
      BotChat.App({
        directLine: { secret: direct_line_secret },
        user: { id: 'userid' },
        bot: { id: 'botid' },
        resize: 'detect'
      }, document.getElementById("bot"));
    </script>
  </body>
</html>

Add the following line in the head to modify the charset:

<meta http-equiv="content-type" content="text/html; charset=utf-8"></meta>