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

Your robot can be more than a simple automated machine with the power of ARC Pro!

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