Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Wrong spell checker on russian (and probably other languages)
BlueHazzard:
--- Quote ---You have no guarantees that the user has the files for this locale. It is highly unlikely that this would happen but, still.
--- End quote ---
It would be great if someone who knows the UTF stuff on linux would help... I can not find any information how to get iswspace working on linux. If the default locale is "C" it does not work "C.utf8" is not present on my default fresh install on linux so i avoid it. i think en_US.utf8 is present on all systems, and if not, hey, at the current stage the spell checker does not work anyway, so better then nothing, and if someone has a problem we can try to fix it. This will work 99% of the time and i think we should stick to this... Again, if someone knows how to handle this i am open for it, but after 2 days of googling i can not find the right approach...
--- Quote ---Also setlocale modifies the locale of the whole thread, and it is slow...
--- End quote ---
Yes i agree here, see my previous post about using iswspace_l
--- Quote ---Putting bad words in the comments is also unacceptable.
Why is UTF8toUTF32 returning int32_t and not uint32_t? Why is UTF32toUTF16 using plain types and not sized types?
--- End quote ---
I was frustrated... Thank you about the types, i missed them, was to late...
--- Quote ---Have you considered using these things: https://www.scintilla.org/ScintillaDoc.html#SCI_WORDENDPOSITION ?
--- End quote ---
This would probably mean to rewrite the whole plugin. No time and motivation for that... Also i can not read from the documentation if this is full unicode aware... You probably have to set the word characters by yourself (https://www.scintilla.org/ScintillaDoc.html#SCI_SETWORDCHARS)
oBFusCATed:
Piling up workarounds doesn't improve things and sooner or later leads to a re-write.
So why don't you do the rewrite at this very moment and save yourself some time and extra work? :)
The set of word characters is probably correct, because ctrl-left, ctrl-right seem to work correctly or at least they are adequate.
And I think these use the current locale set on the editor or it might be using UTF8 internally. I'm not sure.
But anyway scintilla should handle encodings well, because this is one of its main tasks.
p.s. Also have you measured performance? All these calls your making aren't cheap at all!
osdt:
--- Quote from: BlueHazzard on October 19, 2019, 01:13:13 pm ---
--- Quote ---.. patches with calls to setlocale(LC_ALL, "en_US.utf8"); are really unacceptable.
--- End quote ---
It would be great if someone who knows the UTF stuff on linux would help... I can not find any information how to get iswspace working on linux. If the default locale is "C" it does not work ...
--- End quote ---
A single call to ::setlocale(LC_ALL, "") (or at least LC_CTYPE) early at CB startup will be the way to go. It's needed by many character conversion functions, even wxString::mb_str(...) and friends needs it to be set correctly.
--- Quote from: http://man7.org/linux/man-pages/man3/iswspace.3.html --- The behavior of iswspace() depends on the LC_CTYPE category of the current locale.
--- End quote ---
BlueHazzard:
After the first anger and laziness i tried the Scintilla functions and they seem to work quite well... Would be cool if someone with an "exotic" (non ASCII) directory could test this more. I tested it with the Russian dictionary, but i really can only c&p words from google and do not know if they are correct...
Here is the patch. About performance... I have not really tested it, but this should be quite faster then the old approach (if Scintilla is decent fast in word finding, but i think it is)... Also, we are not a word processor, but a programming ide....
oBFusCATed:
--- Quote from: BlueHazzard on October 22, 2019, 09:28:11 am ---Also, we are not a word processor, but a programming ide....
--- End quote ---
What do you mean by this? I regularly have to edit 10-20kloc files. They feel rather sluggish.
If people want to use a slow IDE there are plenty of options (like vscode).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version