HTTP - Webserver - Encoding/Decoding

Posted on
  • Hi guys,

    can someone explain the following behaviour?

    Why I can't decode the string?

    process.env
    ={
    VERSION: "2v00",
    GIT_COMMIT: "ff35517",
    BOARD: "ESP8266_4MB",
    FLASH: 0, RAM: 81920,
    SERIAL: "cc50e30f-0b50",
    CONSOLE: "Serial1",
    MODULES: "Flash,Storage,hea" ... "r,crypto,neopixel",
    EXPTR: 1073643636 }

    Best regards


    1 Attachment

    • ESPRUINO_DECODING_ENCODING.PNG
  • You are using a special character > 127 and that does not look like these are supported.

  • Wed 2019.01.30

    https://developer.mozilla.org/en-US/docs­/Web/JavaScript/Reference/Global_Objects­/encodeURIComponent

    chars as part of RFC spec

    https://tools.ietf.org/html/rfc3986



    May we ask what specifically is attempted to be decoded and for what purpose? There may be other ways to skin a rabbit . . .

  • If you try decodeURIComponent("%E4") in your web browser it'll fail too - so Espruino is just attempting to implement it as per the spec.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

HTTP - Webserver - Encoding/Decoding

Posted by Avatar for user97432 @user97432

Actions