Merge Irssi 0.8.16-rc1
[silc.git] / apps / irssi / src / fe-text / term.c
index 59c3fe4d49406f0025f91f8ee5192946d12ad436..38239016378dfdca20cf2020b232584b217d35e0 100644 (file)
@@ -13,9 +13,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
 #include "module.h"
 #include "term.h"
 #include "mainwindows.h"
 
-#ifdef HAVE_NL_LANGINFO
-#  include <langinfo.h>
-#endif
-
 #ifdef HAVE_SYS_IOCTL_H
 #  include <sys/ioctl.h>
 #endif
@@ -38,7 +34,7 @@
 
 #define MIN_SCREEN_WIDTH 20
 
-int term_width, term_height, term_detached;
+int term_width, term_height;
 
 int term_use_colors;
 int term_type;
@@ -116,13 +112,11 @@ static void read_settings(void)
        int old_colors = term_use_colors;
         int old_type = term_type;
 
-        term_auto_detach(settings_get_bool("term_auto_detach"));
-
         /* set terminal type */
        str = settings_get_str("term_charset");
-       if (g_strcasecmp(str, "utf-8") == 0)
+       if (g_ascii_strcasecmp(str, "utf-8") == 0)
                term_type = TERM_TYPE_UTF8;
-       else if (g_strcasecmp(str, "big5") == 0)
+       else if (g_ascii_strcasecmp(str, "big5") == 0)
                term_type = TERM_TYPE_BIG5;
        else
                term_type = TERM_TYPE_8BIT;
@@ -145,24 +139,22 @@ static void read_settings(void)
 
 void term_common_init(void)
 {
+       const char *dummy;
 #ifdef SIGWINCH
        struct sigaction act;
 #endif
        settings_add_bool("lookandfeel", "colors", TRUE);
        settings_add_bool("lookandfeel", "term_force_colors", FALSE);
-        settings_add_bool("lookandfeel", "term_auto_detach", FALSE);
         settings_add_bool("lookandfeel", "mirc_blink_fix", FALSE);
 
        force_colors = FALSE;
        term_use_colors = term_has_colors() && settings_get_bool("colors");
         read_settings();
 
-#if defined (HAVE_NL_LANGINFO) && defined(CODESET)
-       if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0) {
+       if (g_get_charset(&dummy)) {
                term_type = TERM_TYPE_UTF8;
                term_set_input_type(TERM_TYPE_UTF8);
        }
-#endif
 
        signal_add("beep", (SIGNAL_FUNC) term_beep);
        signal_add("setup changed", (SIGNAL_FUNC) read_settings);