sfree(id);
}
+int frontend_is_utf8(void *frontend)
+{
+ struct gui_data *inst = (struct gui_data *)frontend;
+ return inst->ucsdata.line_codepage == CS_UTF8;
+}
+
char *setup_fonts_ucs(struct gui_data *inst)
{
int shadowbold = conf_get_int(inst->conf, CONF_shadowbold);
const char *get_x_display(void *frontend);
int font_dimension(void *frontend, int which);/* 0 for width, 1 for height */
long get_windowid(void *frontend);
+int frontend_is_utf8(void *frontend);
/* Things gtkdlg.c needs from pterm.c */
void *get_window(void *frontend); /* void * to avoid depending on gtk.h */
pty_open_master(pty);
/*
- * Set the backspace character to be whichever of ^H and ^? is
- * specified by bksp_is_delete.
+ * Set up configuration-dependent termios settings on the new pty.
*/
{
struct termios attrs;
tcgetattr(pty->master_fd, &attrs);
+
+ /*
+ * Set the backspace character to be whichever of ^H and ^? is
+ * specified by bksp_is_delete.
+ */
attrs.c_cc[VERASE] = conf_get_int(conf, CONF_bksp_is_delete)
? '\177' : '\010';
+
+ /*
+ * Set the IUTF8 bit iff the character set is UTF-8.
+ */
+#ifdef IUTF8
+ if (frontend_is_utf8(frontend))
+ attrs.c_iflag |= IUTF8;
+ else
+ attrs.c_iflag &= ~IUTF8;
+#endif
+
tcsetattr(pty->master_fd, TCSANOW, &attrs);
}