Page 1 of 1

Non-ascii chars of the input get ignored

Posted: Fri Jul 23, 2021 6:56 am
by aivarannamaa
I observed a weird behavior on Pico -- when the program calls input() and I'm entering non-ascii characters, these chars are not echoed and don't make it to the interpreter.

In order to rule out issues with the serial terminal program, I experimented with Pyserial:

Code: Select all

import serial

s = serial.Serial("/dev/ttyACM0")
s.write("name = 'mõdu';print('Name:', name, len(name))\r\n".encode("utf-8"))
while True:
    print(s.readline().decode("utf-8"), end="")
The result was:

Code: Select all

name = 'mdu';print('Name:', name, len(name))
Name: mdu 3
As you see, the letter "õ" didn't make it through.

Same problem occurs with ESP-32 and Unix ports. On the other hand -- CircuitPython 7.0.0a3 handles non-ascii input nicely.

Is it a known issue or limitation or should I file a bug report?

Re: Non-ascii chars of the input get ignored

Posted: Sat Jul 24, 2021 8:32 am
by williamhenrick
I think you should file a bug report, it is weird.

Re: Non-ascii chars of the input get ignored

Posted: Sun Jul 25, 2021 8:37 am
by aivarannamaa
williamhenrick wrote:
Sat Jul 24, 2021 8:32 am
I think you should file a bug report, it is weird.
I did so: https://github.com/micropython/micropython/issues/7585

Re: Non-ascii chars of the input get ignored

Posted: Sun Jul 25, 2021 9:46 pm
by williamhenrick
Ahan good, I will follow it. Although I am working on UNO for now but I am thinking of going to Pi so studying micropython.