cslarsen / wpm

Typeracer-like console app for measuring your WPM
GNU Affero General Public License v3.0
322 stars 48 forks source link

UTF-8 input problems #15

Closed cslarsen closed 6 years ago

cslarsen commented 6 years ago

In general, UTF-8 characters not only do not work properly, hitting one involuntarily will give a warning, obscuring the text. Need to fix that across python 2 and 3.

felixwiemuth commented 6 years ago

For me, typing "ö" or "ø" also jumps over two characters in the given text and prints wrong characters on the input.

cslarsen commented 6 years ago

@felixwiemuth Does it always do this? For me, it prints an error the first time I type out a UTF-8 character, then it's ignored. Which version of Python are you using?

felixwiemuth commented 6 years ago

I use Python 3.6.4 on Linux. It always proceeds by two characters when typing these letters. It is also shown as "wrong" in red but nothing is ignored. In the following example I have typed "aäüÖ" (that is, always where the cursor is on): 2018-03-21-232202_856x139_scrot

cslarsen commented 6 years ago

For Python 3.3+, I believe this has been fixed in commit 8629a9e16a58633131a1d738a63507e8786c0f14.

You can try to clone the repo and type "make run3" to run the Python3 version. If that works, I'll soon prepare an official PyPi release.

cslarsen commented 6 years ago

It was fixed in Python 2.7 in commit 6dd9408acc

felixwiemuth commented 6 years ago

Thanks, it works!

cslarsen commented 6 years ago

Great! Thanks for testing!