changeset 9145:ab8238290141

sub_utf8 handling hopefully fixed
author henry
date Tue, 28 Jan 2003 18:45:58 +0000
parents d33fe13de7ae
children 257145c38aaa
files subreader.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Tue Jan 28 18:38:26 2003 +0000
+++ b/subreader.c	Tue Jan 28 18:45:58 2003 +0000
@@ -923,7 +923,6 @@
 	if (sub_cp){
 		if ((icdsc = iconv_open (tocp, sub_cp)) != (iconv_t)(-1)){
 			mp_msg(MSGT_SUBREADER,MSGL_V,"SUB: opened iconv descriptor.\n");
-			sub_utf8_prev=sub_utf8;
 			sub_utf8 = 2;
 		} else
 			mp_msg(MSGT_SUBREADER,MSGL_ERR,"SUB: error opening iconv descriptor.\n");
@@ -935,7 +934,6 @@
 	if (icdsc != (iconv_t)(-1)){
 		(void) iconv_close (icdsc);
 		icdsc = (iconv_t)(-1);
-		sub_utf8=sub_utf8_prev;
 	   	mp_msg(MSGT_SUBREADER,MSGL_V,"SUB: closed iconv descriptor.\n");
 	}
 }
@@ -1100,6 +1098,7 @@
     rewind (fd);
 
 #ifdef USE_ICONV
+    sub_utf8_prev=sub_utf8;
     subcp_open();
 #endif
 
@@ -1131,6 +1130,7 @@
 	 {
 #ifdef USE_ICONV
           subcp_close();
+          sub_utf8=sub_utf8_prev;
 #endif
     	  if ( first ) free(first);
 	  return NULL;