--- rxvt-unicode/src/ptytty.C 2004/09/30 09:49:13 1.17 +++ rxvt-unicode/src/ptytty.C 2005/01/11 04:44:57 1.22 @@ -48,11 +48,14 @@ #ifdef HAVE_ISASTREAM # include #endif +#ifdef HAVE_PTY_H +# include +#endif // better do this via configure, but.... #if defined(__FreeBSD__) # include -#elif defined(__DARWIN__) +#elif defined(__DARWIN__) || (defined (__MACH__) && defined (__APPLE__)) # include #endif @@ -438,5 +441,32 @@ return true; } +void +rxvt_ptytty::set_utf8_mode (bool on) +{ +#ifdef IUTF8 + if (pty != -1) + { + struct termios tio; + + if (tcgetattr (pty, &tio) != -1) + { + tcflag_t new_cflag = tio.c_iflag; + + if (on) + new_cflag |= IUTF8; + else + new_cflag &= ~IUTF8; + + if (new_cflag != tio.c_iflag) + { + tio.c_iflag = new_cflag; + tcsetattr (pty, TCSANOW, &tio); + } + } + } +#endif +} + /*----------------------- end-of-file (C source) -----------------------*/