mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-04 04:52:47 -05:00
Make bidi work with wide characters.
Previously, any double-width character would break the bidi algorithm, because of the quirk of data representation in which we store UCSWIDE (0xDFFF) in the right-hand termchar overlapped by the character. UCSWIDE has bidirectional character class L according to minibidi's getType(), so it disrupted the algorithm. Now we remove UCSWIDE from the input line before passing it to do_bidi(), replacing it with an 'nchars' field in the bidi_char structure indicating single or double width, and put the UCSWIDEs back afterwards once do_bidi returns.
This commit is contained in:
2
putty.h
2
putty.h
@ -1899,7 +1899,7 @@ void setup_config_box(struct controlbox *b, bool midsession,
|
||||
*/
|
||||
typedef struct bidi_char {
|
||||
unsigned int origwc, wc;
|
||||
unsigned short index;
|
||||
unsigned short index, nchars;
|
||||
} bidi_char;
|
||||
int do_bidi(bidi_char *line, int count);
|
||||
int do_shape(bidi_char *line, bidi_char *to, int count);
|
||||
|
Reference in New Issue
Block a user