diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-05-11 00:54:59 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-05-11 00:54:59 +0200 |
commit | edca217bb99f7c32413c117239d12acdc223e811 (patch) | |
tree | c77aa8a8494ffe8784bf3b4e264579a50c2c4233 /sys/src/cmd/tcs/utf.c | |
parent | 7388792a124756a528666cb5c375ee919db9ca11 (diff) |
tcs: handle surrogate pairs
Diffstat (limited to 'sys/src/cmd/tcs/utf.c')
-rw-r--r-- | sys/src/cmd/tcs/utf.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/src/cmd/tcs/utf.c b/sys/src/cmd/tcs/utf.c index 764ef9f7b..381c5facc 100644 --- a/sys/src/cmd/tcs/utf.c +++ b/sys/src/cmd/tcs/utf.c @@ -27,13 +27,12 @@ int fullisorune(char *str, int n); int isochartorune(Rune *rune, char *str); void -utf_in(int fd, long *notused, struct convert *out) +utf_in(int fd, long *, struct convert *out) { char buf[N]; int i, j, c, n, tot; - ulong l; + unsigned long l; - USED(notused); tot = 0; while((n = read(fd, buf+tot, N-tot)) >= 0){ tot += n; @@ -65,12 +64,11 @@ utf_in(int fd, long *notused, struct convert *out) } void -utf_out(Rune *base, int n, long *notused) +utf_out(Rune *base, int n, long *) { char *p; Rune *r; - USED(notused); nrunes += n; for(r = base, p = obuf; n-- > 0; r++){ p += our_wctomb(p, *r); @@ -80,12 +78,11 @@ utf_out(Rune *base, int n, long *notused) } void -isoutf_in(int fd, long *notused, struct convert *out) +isoutf_in(int fd, long *, struct convert *out) { char buf[N]; int i, j, c, n, tot; - USED(notused); tot = 0; while((n = read(fd, buf+tot, N-tot)) >= 0){ tot += n; @@ -117,12 +114,11 @@ isoutf_in(int fd, long *notused, struct convert *out) } void -isoutf_out(Rune *base, int n, long *notused) +isoutf_out(Rune *base, int n, long *) { char *p; Rune *r; - USED(notused); nrunes += n; for(r = base, p = obuf; n-- > 0; r++) p += runetoisoutf(p, r); |