mirror of
https://github.com/0intro/conterm
synced 2024-11-22 05:41:28 +03:00
8de603bff1
On Windows, the clipboard strings are encoded in UTF-16. However, Drawterm considers them as Rune. It used to work when a Rune was a short, but a Rune is now a int. The solution is to implement Rune16 functions to handle UTF-16 strings. The Rune16 functions were written by Charles Forsyth as part of Inferno. Balaji Srinivasa integrated them into Drawterm.
12 lines
321 B
C
12 lines
321 B
C
typedef unsigned short Rune16;
|
|
|
|
wchar_t *widen(char *s);
|
|
char *narrowen(wchar_t *ws);
|
|
int widebytes(wchar_t *ws);
|
|
int runes16len(Rune16*);
|
|
int rune16nlen(Rune16*, int);
|
|
Rune16* runes16dup(Rune16*);
|
|
Rune16* utftorunes16(Rune16*, char*, int);
|
|
char* runes16toutf(char*, Rune16*, int);
|
|
int runes16cmp(Rune16*, Rune16*);
|