/*
* Translate Unicode to HTML by asking tcs(1).
* This way we don't have yet another table.
*/
Rune*
rune2html(Rune r)
{
static Biobuf b;
static int fd = -1;
static Rune **tcscache[256];
int p[2];
char *q;
if(r == '\n')
return L("\n");
if(((uint)r&~0xFFFF) != 0){
/* The cache must grow a lot to handle them */
fprint(2, "%s: can't handle rune '%C'\n", argv0, r);
return L("?");
}
/*
* Translate troff to Unicode by looking in troff's utfmap.
* This way we don't have yet another hard-coded table.
*/
typedef struct Trtab Trtab;
struct Trtab
{
char t[UTFmax];
Rune r;
};