TextInputEvent.Text encoding for different languages
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: Official Release
Version: 4.1.0.1838
Platform(s): Windows
Describe the bug
When I enable text input events and try to get them, events text can get wrong encoding with some languages.
I found this bug when testing Cyrillic and Greek characters input, with English, German or Japanese it worked fine.
To Reproduce
Steps to reproduce the behavior:
- Create a project with the TextEdit control (this is the simplest way to get and visualize input events).
- Install any Cyrillic or Greek keyboard layout
- Try to input something into the TextEdit with different languages and see what is displayed in the TextEdit
- Compare it with the text typed in the Notepad or any other apps
Expected behavior
Text encoding should've been detected correctly, all languages should be encoded in the same encoding.
Screenshots
Additional context
I found out that I can get Cyrillic letters back with changing encoding from UTF-16 to Windows-1251. Also Greek letters can be get when changing the encoding from UTF-16 to Windows-1253. However, when changing the encoding, Japanese letters are lost.
Also, when you copy and paste the text into the game, it is handled correctly, letters are the same as copied
So what can I do to keep all languages available for input?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Windows TextInputEvent handling used by the TextEdit control and reproduce the issue with Cyrillic, Greek, English, German, and Japanese keyboard layouts. Compare the event text with Notepad and verify that UTF-16 preserves every language without language-specific encoding changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100