Avatar for Spyro

Spyro

Member since Apr 2019 • Last active Apr 2019
  • 1 conversations
  • 1 comments

Most recent activity

  • in ESP8266
    Avatar for Spyro

    Hi everyone! When i trying send some cyrillic text via using

    require("http").createServer
    

    i getting very strange results.

    Here is my code:

    var wifi = require("Wifi");
    
    wifi.connect('ssid', { password: 'pass'},function(s) {
      console.log(s);
      console.log(wifi.getIP());
    });
    
    function onPageRequest(req, res) {
      var a = url.parse(req.url, true);
      if (a.pathname=="/") {
        res.writeHead(200, {'Content-Type': 'text/html'});
        res.end('Hello World! Привет Мир!');
      }
    }
    require("http").createServer(onPageReque­st).listen(80);
    
    

    And that's what i getting in my browser:

    "Hello World! AFD0C8C2C5D2 ACC8D0!"

    Can someone explain me, what i'm doing wrong? Thanks!

Actions