Changes between Version 1 and Version 2 of Ticket #4138, comment 21


Ignore:
Timestamp:
11/03/21 21:01:31 (3 years ago)
Author:
ZGMxYWFh
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4138, comment 21

    v1 v2  
    1010That is partially wrong. I am quite sure many of you are well aware of https://en.wikipedia.org/wiki/Mirror_writing. [[br]][[br]]The scientists observed that normal children exhibited signs of mirror writing while learning to write[[br]][[br]]is copied from that Wikipedia page. It could be some of you were also part of that children group. The bug issue is more complex, but not incredibly complex. MC has to deal with lines where some parts of the line progress in the left to right direction you are accustomed to. While other parts of those same lines progress in a right to left direction. Exactly the opposite of what you are used to. As in[[br]][[br]] 
    1111Midnight Commander - rednammoC thgindiM[[br]][[br]] 
    12 If you don't see it immediately, the left part of the line above reads MC in the usual direction. While the right part reads MC in the opposite direction. And there is a question if the computer should display it in the correct direction? And if so, how? How the computer would be able to keep such strings in its memory, and still have the terminal, or while making a hard copy of it, display it the way the user expects it. How the computer would know what is the left most letter? If you like, this is a more complex version of the question how the computer marks to itself the end of string, NULL character, while still keep it distinct from the other part of the string. Or how can the computer tell that some byte sequences are sometime English letters, sometimes Russian letters, and some times something else. Neither English. Nor Russian. 
     12If you don't see it immediately, the left part of the line above reads MC in the usual direction. While the right part reads MC in the opposite direction. And there is a question if the computer should display it in the correct direction? And if so, how? How the computer would be able to keep such strings in its memory, and still have the terminal, or while making a hard copy of it, display it the way the user expects it. How the computer would know what is the left most letter? If you like, this is a more complex version of the question how the computer marks to itself the end of string, NULL character, while still keep it distinct from the other part of the string. Or how can the computer tell that some byte sequences are sometime English letters, sometimes Russian letters, and sometimes something else. Neither English. Nor Russian. 
    1313> and can't provide help fixing it - we just don't have skills 
    1414That is totally wrong. Absolutely wrong. You can provide help. You have the skills. 
    1515The reason is that some other people already did part of the work. They have written an algorithm. https://www.unicode.org/reports/tr9/. One does not have to speak an RTL language to read that page. There is also an open source implementation. http://fribidi.org. Some terminals attempt to use it. Or be able to cope with applications that use it.  
    1616> (you don’t have) time for it. 
    17 Unfortunately, With that I absolutely agree with you. 
     17Unfortunately, with that I absolutely agree with you. 
    1818 
    1919What I think has to be done is 
    20201. Before attempting to fix something, some preparation has to be done. Such as for MC to be able to automatically see if the underlying terminal uses libfribidi. If that is too hard, check the name of the underlying terminal (xterm, lxterminal, and so on), and its version. As a last resort, let the user set a variable at .config/mc/ini . Stating he want MC to run in a bidi aware terminal. 
    21 2. The next step is to be able to insert a unicode sequence, such as[[br]][[br]]Quoting https://www.unicode.org/reports/tr9/ [[br]]LRO  U+202D  LEFT-TO-RIGHT OVERRIDE  Force following characters to be treated as strong left-to-right characters[[br]][[br]]End of quote. Immediately after the columns separator character, at each column, and at row, of that column. And an[[br]][[br]]Quoting https://www.unicode.org/reports/tr9/ [[br]]PDI    U+2069  POP DIRECTIONAL ISOLATE         End the scope of the last LRI, RLI, or FSI[[br]][[br]]End of quote. Immediately before the columns separator character, at each column, and at each row, of that column.  
     212. The next step is to be able to insert a unicode sequence, such as[[br]][[br]]Quoting https://www.unicode.org/reports/tr9/ [[br]]LRO  U+202D  LEFT-TO-RIGHT OVERRIDE  Force following characters to be treated as strong left-to-right characters[[br]][[br]]End of quote. Immediately after the columns separator character, at each column, and at each row, of that column. And an[[br]][[br]]Quoting https://www.unicode.org/reports/tr9/ [[br]]PDI       U+2069  POP DIRECTIONAL ISOLATE         End the scope of the last LRI, RLI, or FSI[[br]][[br]]End of quote. Immediately before the columns separator character, at each column, and at each row, of that column.  
    22223. Hopefully, the above will isolate each row of each column, so that it could be treated separately from the other rows, and the other columns. And then see if the bidi layer of the terminal handle those rows without necessitating more intervention by MC. It would also set the construct, so that more people could see where to write additional code. Sort of hooks to add more patches. 
    2323