-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial support for UTF-8 text input #8098
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (1/1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (1/1)
Hi, @ihhub ! |
Hi @Branikolog
When you select English as game language, no Russian or Belarussian fonts exist, so when Russian or Belarussian symbols are coming from the keyboard, they are ignored.
In |
Hello, @oleg-derevenetz .
I'm just speaking as a common user. :) If the game language is set as English, it is implied, that no other languages could be used to type texts. So I expect only Latin symbols to appear. In that case I feel there's no need to select exactly English within OS to type, since no other symbols are allowed. We've already had some complains on MAC, as I mentioned above, that game forces user to switch OS input language to be able to add text. |
Hi @ihhub there are my observations:
|
Hi @oleg-derevenetz , thanks for the notes! I will try to test on Android and on Linux. Most likely these OSes behave differently from Windows. |
Please see my notes above. If no key information comes for non-English symbols (only their UTF-8 symbol codes) there is no way to match these UTF-8 symbols to corresponding English symbols on the same keyboard keys (i.e. |
Hi @ihhub
Also please note that, although I couldn't verify it, there will be issues with national symbols in file names on Linux. Although Linux filesystems (such as EXT3) are encoding-agnostic (i.e. they treat file names just as an array of bytes), particular apps (e.g. shell) will treat file names according to their locale settings (set via |
Hi @oleg-derevenetz , I believe we shouldn't allow to enter non-English names for files at the moment. |
I actually don't know how exactly things happen in the code regarding to symbol codes. |
Complaints like "I just told my OS that I want to enter non-English letters, but your program should magically turn these non-English letters into English letters" seem absurd to me. It's not worth the effort. If someone wants this behavior, they can implement it themselves and offer a pull request. Good luck to them with the support of the entire zoo of devices and OS for this. |
Hi, @ihhub. The CP1251 letters works good for me (Win10), but I cannot input some symbols: |
Hi @Branikolog , what was before doesn't mean it was correct. We will see what we could do about this. @Districh-ru , most likely it is because out CP-1251 font does not contain all symbols. |
relates to #8098 If a user has active CAPS LOCK and uses SHIFT while typing, the letters must be non-capital.
Quality Gate failedFailed conditions 1 New Major Issues (required ≤ 0) See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
As of now only CP-1251 is being implemented (as @Branikolog was eating my brain too much). You can test changes by using your OS keyboard layout and try to type one of CP-1251 languages. For example, Player Name in the multiplayer mode.
Note: SDL interprets Ctrl + Key combination as not a text input and falls back to English keyboard.
relates to #7933, #6845 and #6207