projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ronald Landheer-Cieslak points out that the various back ends which
[u/mdw/putty]
/
ldiscucs.c
diff --git
a/ldiscucs.c
b/ldiscucs.c
index
c4fc726
..
fe0da8a
100644
(file)
--- a/
ldiscucs.c
+++ b/
ldiscucs.c
@@
-51,13
+51,12
@@
void luni_send(void *handle, wchar_t * widebuf, int len, int interactive)
for (p = linebuffer, i = 0; i < len; i++) {
unsigned long ch = widebuf[i];
for (p = linebuffer, i = 0; i < len; i++) {
unsigned long ch = widebuf[i];
- if (
(ch & 0xF800) == 0xD800
) {
+ if (
IS_SURROGATE(ch)
) {
#ifdef PLATFORM_IS_UTF16
if (i+1 < len) {
unsigned long ch2 = widebuf[i+1];
#ifdef PLATFORM_IS_UTF16
if (i+1 < len) {
unsigned long ch2 = widebuf[i+1];
- if ((ch & 0xFC00) == 0xD800 &&
- (ch2 & 0xFC00) == 0xDC00) {
- ch = 0x10000 + ((ch & 0x3FF) << 10) + (ch2 & 0x3FF);
+ if (IS_SURROGATE_PAIR(ch, ch2)) {
+ ch = FROM_SURROGATES(ch, ch2);
i++;
}
} else
i++;
}
} else