Non-ascii chars of the input get ignored

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
aivarannamaa
Posts: 171
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Non-ascii chars of the input get ignored

Post by aivarannamaa » Fri Jul 23, 2021 6:56 am

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?
Aivar Annamaa
https://thonny.org

williamhenrick
Posts: 16
Joined: Wed Jul 14, 2021 8:58 am

Re: Non-ascii chars of the input get ignored

Post by williamhenrick » Sat Jul 24, 2021 8:32 am

I think you should file a bug report, it is weird.

User avatar
aivarannamaa
Posts: 171
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: Non-ascii chars of the input get ignored

Post by aivarannamaa » Sun Jul 25, 2021 8:37 am

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
Aivar Annamaa
https://thonny.org

williamhenrick
Posts: 16
Joined: Wed Jul 14, 2021 8:58 am

Re: Non-ascii chars of the input get ignored

Post by williamhenrick » Sun Jul 25, 2021 9:46 pm

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.

Post Reply