France
Asked — Edited

Http Server Question With É

Hello, after several tests and with 2 PCs (Windows 10, 32 bits and 64 bits in French), I have this bug with accents. I also tried with PandoraBot and SynBot. é is replaced by ? The Http server page doesn't recognize them. If I say "Quelle est ta date de naissance" it works. But I have this answer "Je suis n? le 7 d?cembre 2001" If I say "Quand es tu né" I don't have an answer. On the other hand it works if I write directly in Pandorabot and Synbot. An idea to correct that? I know that the Http server page (custom) generates the page in UTF-8 with <meta charset="utf-8" /> but I dont know how to do it for the Http server page. Thank you

User-inserted image


ARC Pro

Upgrade to ARC Pro

Synthiam ARC Pro is a new tool that will help unleash your creativity with programming robots in just seconds!

#1  

If I try with Bing Speech Recognition everything works. But if I try with the Http Server page and a voice recognition framework that uses it, it does not work. This :

 var url = 'http://192.168.1.78/exec?password=admin&amp;script=Botquery(&quot;'+phrase+'&quot;)'; 

or this

 var url = 'http://192.168.1.78/exec?password=admin&amp;script=ControlCommand(&quot;PandoraBot&quot;, SetPhrase, &quot;'+phrase+'&quot;)'; 

if I say "bonne journée" send :

http://192.168.1.78/exec?password=admin&amp;script=Botquery(&quot;bonne journ&#233;e&quot;)

but don't work. If I say "bonjour" it works

I can't be more specific.

#4  

@ptp Of course it will work but here is the answer generated: "Je suis n? le 7 d?cembre 2001" Whether I use the framework or not I have the same answer with ? instead of é. That I use Pandorabot and Synbot with Http server I get the same thing.

#5  

All my AIML or SIML files are encoded in UTF-8

 &lt;? xml version = &quot; 1.0 &quot; encoding = &quot; utf-8 &quot;
PRO
Synthiam
#6  

Understood - but to transfer data over http requests requires encoding. Which is why you see encoded characters in urls of your favorite websites.

Post more details of your project and we’ll help by understanding more to ensure we give the right solution. Either way, http urls need encoding as it’s a defined standard by the http protocol.

#7  

Okay. I'll see that tomorrow. It is 3:29 in France. Thanks for your help. sleep

PRO
USA
#9  

@DJ: The Http Server control has a bug/problem with the encoding.

steps to reproduce: 1) Start an empty project with http server and variable watcher control

2) set a variable $text1 with some accents:


#script: $text1=&quot;Accents: &#231; &#225;&#224;&#227;&#226; &#233;&#232;&#234;&#235; &#237;&#236;&#238;&#239; &#243;&#242;&#244;&#245; &#250;&#249;&#251;&#252;&quot;
#the script content is encoded using the required url encode method.

http://192.168.18.108:8000/exec?password=admin&amp;script=%24text1%3D%22Accents%3A%20%C3%A7%20%C3%A1%C3%A0%C3%A3%C3%A2%20%C3%A9%C3%A8%C3%AA%C3%AB%20%C3%AD%C3%AC%C3%AE%C3%AF%20%C3%B3%C3%B2%C3%B4%C3%B5%20%C3%BA%C3%B9%C3%BB%C3%BC%22

The variable is correctly assigned and ez-scripts prints the variable too:

User-inserted image

4) retrieve the variable content:


#script: print($text1)
http://192.168.18.108:8000/exec?password=admin&amp;script=print(%24text1)

User-inserted image

User-inserted image

The content returned is broken!

#10  

@ptp Thank you very much for finding. When I was doing a wikipedia search it worked but with http server didn't works. This confirms my doubts. Another thing with Synbot, when I want to use the console script tab with Http server the page doesn't exist.

#11  

Solved for accent recognition in the Http query. I edit this in my javascript file and it works now.

var encoded = encodeURI(url);
console.log(encoded);

var request = require('request');
   request ({ 'uri' : encoded, 'htm' : false }, function (err, response, body){..... 

But for the return of the text in the page Http server, we always have pr?f?r? and not préféré.

PRO
USA
#12  

Quote:

Another thing with Synbot, when I want to use the console script tab with Http server the page doesn't exist.

Can you please explain/detail the issue ?

#13  

It's not too bad because the plugin works perfectly. But when I click on the Script Console page does not work. This is only done with Synbot. If I delete the plugin the page works again.

User-inserted image

User-inserted image

PRO
USA
#14  

@Reaktor: That's an Interesting finding, although is not related to SynBot.

@DJ: It happens when you have a project with http server a plugin component and you use script console (browser)

Test: Dynamixel plugin with http server

User-inserted image