Author Topic: beta6: Cursor up/down jumps left for multibyte UTF-8 chars  (Read 1551 times)


  • Community Member
  • Posts: 94
  • Hero Points: 11
beta6: Cursor up/down jumps left for multibyte UTF-8 chars
« on: October 27, 2014, 10:19:44 pm »
Just noticed a trivial and (mostly) harmless feature in UTF-8 documents, which is especially weird with the "Cursor up/down places cursor in virtual space" is enabled:

The cursor doesn't go down/up in a straight line if there are multibyte UTF-8 encoded characters to the left of the cursor.  (Smells like some mixup of visual string offsets and encoded string byte offsets.)

For example, place the cursor after "hot=" in the below XML example and cursor down. It makes a big jump to the left on the Vietnamese name of the dish, jumps back to where you expect on the english name, and goes one to the left when reaching the German name.
Code: [Select]
            <Item number="Sp2" price="16.80" hot="medium" plu="702" targetgroup="8">
                <Name lang="vn">Tiếng sáo động</Name>
                <Name lang="en" checkme="true">Paddy Field Piper</Name>
                <Name lang="de">Flötender Reisbauer</Name>
                <Text lang="de">Knusprige Ente und verschiedene Fleischsorten
                    mit Gemüse der Saison, in Kokosmilch und gelber Currysauce nach Saigon-Art.
                    Reis als Beilage.</Text>
                <Text lang="en" checkme="true">Crispy duck and various kinds of meats with seasonal vegetables in
                    Saigon-style coconut milk yellow curry sauce. Served with a side of rice.</Text>

This is just FYI. I can see that this fiddly stuff and I don't really have all that many documents with lots of UTF-8 in them (this document and a couple of html/php files), so feel free to ignore the report. :-)