Bug #419
B1.6.13 - Text lost when typing, pasting with Amharic data
| Status: | Closed | Start: | 04/07/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | 04/07/2010 | |
| Assigned to: | John Wimbish | % Done: | 100% |
|
| Category: | Windows | Spent time: | - | |
| Target version: | 1.6x | Estimated time: | 2.00 hours |
Description
A user wrote: "Whenever I try to type something in Amharic script (using the Abysinica_SIl font) and I press the spacebar everything between the first and last space disappears. I used two different keyboard manager (Keyman and another) and also the same effect happens when I copy-paste text from the Amharic text using a word processor."
The issue was in DPhrase.EliminateSpuriousSpaces, which does a string.IndexOf("<space><space>"). For some reason, this was finding spaces between every word in the Amharic text, though spaces aren't really there according to the debugger.
Making the call as
IndexOf(" ", StringComparison.Ordinal)
solved it. Apparently something is interacting wrongly with the CurrentCulture.
I now have a test case that will fail should I ever change it back. Don't really know the cause of the problem; only that it is now solved.