From 189b9e23edfe60b7e82c4c7b6071a3f98799653a Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Tue, 26 Oct 2021 21:32:55 -0700 Subject: fix(unicode): renamed functions to be easier to understand their functions --- sys/cmd/term/term.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/cmd/term/term.c') diff --git a/sys/cmd/term/term.c b/sys/cmd/term/term.c index 6a73a8b..b08915e 100644 --- a/sys/cmd/term/term.c +++ b/sys/cmd/term/term.c @@ -410,7 +410,7 @@ getsel(void) if (gp->mode & Gwdummy) continue; - ptr += utf8·runetobyte(ptr, &gp->u); + ptr += utf8·encode(&gp->u, ptr); } /* @@ -993,7 +993,7 @@ tsetchar(rune u, Letter *attr, int x, int y) */ if (term.trantbl[term.charset] == CSgfx0 && BETWEEN(u, 0x41, 0x7e) && vt100_0[u - 0x41]) - utf8·bytetorune(&u, vt100_0[u - 0x41]); + utf8·decode(vt100_0[u - 0x41], &u); if (term.line[y][x].mode & Gwide) { if (x+1 < term.col) { @@ -1801,7 +1801,7 @@ tdumpline(int n) end = &bp[MIN(tlinelen(n), term.col) - 1]; if (bp != end || bp->u != ' ') { for ( ; bp <= end; ++bp) - tprinter(buf, utf8·runetobyte(buf, &bp->u)); + tprinter(buf, utf8·encode(&bp->u, buf)); } tprinter("\n", 1); } @@ -2090,7 +2090,7 @@ tputc(rune u) c[0] = u; width = len = 1; } else { - len = utf8·runetobyte(c, &u); + len = utf8·encode(&u, c); if(!control && (width = wcwidth(u)) == -1) width = 1; } @@ -2257,7 +2257,7 @@ twrite(char *buf, int buflen, int show_ctrl) for (n = 0; n < buflen; n += charsize) { if(IS_SET(Tutf8) && !IS_SET(Tsixel)) { /* process a complete utf8 char */ - charsize = utf8·bytetorune(&u, buf + n); + charsize = utf8·decode(buf + n, &u); if(charsize == 0) break; } else { -- cgit v1.2.1