[GH-ISSUE #311] Bug with UTF-8 characters in python #138

Open
opened 2026-05-06 13:15:41 +02:00 by BreizhHardware · 0 comments

Originally created by @theodorechle on GitHub (Jan 7, 2023).
Original GitHub issue: https://github.com/UpsilonNumworks/Upsilon/issues/311

Describe the bug
In UTF-8, many characters are one multiple bytes.
In the python app of the calculator, the len function count the number of bytes and not of characters.
Same for list, tuple and set functions : they create a list, tuple or set with all the bytes.

To Reproduce
If you enter :
a="éç"
list(a)
len(a)

It display :
["e","\u0301","c","\u0327"]
4

Expected behavior
Normally (and I try on Vscode to be sure), len just count the number of characters and not the number of bytes who composed them.
Same for list, tuple and set functions. Normally, you just have the characters inside, but not each byte splitted.

Screenshots
On the calculator:
1673101088009
1673101088002

On Vscode:
image

Device (please complete the following information):

  • N110
  • 1.0.1-dev
  • dev
Originally created by @theodorechle on GitHub (Jan 7, 2023). Original GitHub issue: https://github.com/UpsilonNumworks/Upsilon/issues/311 **Describe the bug** In UTF-8, many characters are one multiple bytes. In the python app of the calculator, the len function count the number of bytes and not of characters. Same for list, tuple and set functions : they create a list, tuple or set with all the bytes. **To Reproduce** If you enter : a="éç" list(a) len(a) It display : ["e","\u0301","c","\u0327"] 4 **Expected behavior** Normally (and I try on Vscode to be sure), len just count the number of characters and not the number of bytes who composed them. Same for list, tuple and set functions. Normally, you just have the characters inside, but not each byte splitted. **Screenshots** On the calculator: ![1673101088009](https://user-images.githubusercontent.com/109806523/211155328-55b075d6-f5b5-4cb6-82ac-89ad594804e7.jpg) ![1673101088002](https://user-images.githubusercontent.com/109806523/211155361-f89f877a-0da9-4936-ac8c-ed3f87c0309a.jpg) On Vscode: ![image](https://user-images.githubusercontent.com/109806523/211155311-704fc266-06ae-4f7d-aee2-697f85208190.png) **Device (please complete the following information):** - N110 - 1.0.1-dev - dev
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Upsilon#138
No description provided.