texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.82k stars 345 forks source link

Titlecase operation not working for cyrillic letters #1958

Open VictorItkin opened 2 years ago

VictorItkin commented 2 years ago

Environment

Expected behavior

I want to apply "to Titlecase" operation to cyrillic text, for example "мой текст" and expect to obtain "Мой Текст".

Also it will be more convenient to apply case operations to a word of current cursor place, not selection text only.

Actual behavior

But this operation is workable with latin text only.

The case operations (uppercase, lowercase and titlecase) can be applied only to selection text.

How to reproduce

It is necessary to make these operations as them are made in MS Word. This way is the most convenient.

sunderme commented 2 years ago

the actual code is javascript

muzimuzhi commented 2 years ago

The key seems to add Cyrillic characters to the current regex https://github.com/texstudio-org/texstudio/blob/fe149eb474ba4c97ad7efdca8082c95161c1e7ef/src/texstudio.cpp#L4062

Unicode Block 'Cyrillic' has range \u0400-\u04FF but I'm afraid only a subset of it accounts for normal Cyrillic characters. @VictorItkin Do you have any suggestions about which subset(s) should be used?

Also, texstudio may consider updating to-title-case.js.

VictorItkin commented 2 years ago

Thank you for quick anwer!

The commands "to Uppercase" and "to Lowercase" work correctly. Use the unicode range from these procedures.

Upper case unicode symbols are in range 0410 - 042F, these symbols in lower case are 0430-044F.  There is a separate symbol: Ё (0401) - ё (0451)

The rest of the characters in ranges 0400-040F and 0450-045F are not used in russian texts, but formally are included in "extended cyrillic" block. Some of them are used in Ukrainian texts. You can program replacing  0410 - 042F to  0430-044F and 0400-040F to 0450-045F (and back, certainly). Nobody will use nnnecessary  symbols, but it is not a problem. 

Best regards,  Victor Itkin

P.S. I use Windows 7, but the latest version Texstudio requires Windows 10. Can you fix this bug in older version working under win 7?

Вторник, 23 ноября 2021, 21:58 +03:00 от muzimuzhi @.***>:

The key seems to add Cyrillic characters to the current regex https://github.com/texstudio-org/texstudio/blob/fe149eb474ba4c97ad7efdca8082c95161c1e7ef/src/texstudio.cpp#L4062 Unicode Block 'Cyrillic' has range \u0400-\u04FF but I'm afraid only a subset of it accounts for normal Cyrillic characters. @VictorItkin Do you have any suggestions about which subset(s) should be used? Also, texstudio may consider updating to-title-case.js . — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or unsubscribe . Triage notifications on the go with GitHub Mobile for iOS or Android .

В.Ю. Иткин

sunderme commented 2 years ago

There is no more support of win7. But you can compile txs on your own, see wiki.

sunderme commented 2 years ago

you could try the qt5 version, it may work.