pytermgui icon indicating copy to clipboard operation
pytermgui copied to clipboard

[REQUEST] Handle other alphabets in input fields

Open jbaublitz opened this issue 1 year ago • 4 comments
trafficstars

Is your feature request related to a problem? Please describe. I was planning on using this for a terminal user interface for a flashcard app, but the text input doesn't seem to be able to display the Cyrillic or Arabic alphabet. I'm not sure if this is related to encoding or if there's a way to make the text inputs accept UTF-8, but currently those alphabets aren't displayed when you type them.

Describe the solution you'd like I'd like difference alphabets to be able to be displayed when typed into a text box.

Is this feature present in other TUI products? Yes.

Additional context Arabic might be a little bit hard to handle only because it goes right to left and is cursive, but Cyrillic is usually pretty easy to implement with simply UTF-8 encoding.

jbaublitz avatar Aug 30 '24 13:08 jbaublitz

Does your terminal handle them correctly? I don't see any reason they shouldn't already work, IIRC emoji (mostly) do and those should be more complicated.

bczsalba avatar Aug 31 '24 09:08 bczsalba

Yes, my terminal does handle them correctly. Specifically the behavior I'm seeing is that when I type Cyrillic into the text input box, nothing is displayed.

jbaublitz avatar Sep 01 '24 16:09 jbaublitz

If you run ptg -g and enter a cyrillic character, what does it output?

bczsalba avatar Sep 01 '24 18:09 bczsalba

This was the output.

PyTermGUI - Getch-practice/ ptg -g                  

┌────────────────────────────────────────────────┐
│                   Your output                  │
│                                                │
│ key                                   '\u0440' │
│ value:                                '\u0440' │
│ len()                                        1 │
│ real_length()                                1 │
└────────────────────────────────────────────────┘

jbaublitz avatar Sep 03 '24 00:09 jbaublitz