[Tkabber-dev] r747 - in trunk/tkabber: . plugins/general

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Oct 6 01:23:55 MSD 2006


Author: sergei
Date: 2006-10-06 01:23:51 +0400 (Fri, 06 Oct 2006)
New Revision: 747

Modified:
   trunk/tkabber/ckabber.tcl
   trunk/tkabber/plugins/general/headlines.tcl
   trunk/tkabber/tkabber.tcl
   trunk/tkabber/trans.tcl
Log:
	* plugins/general/headlines.tcl, trans.tcl: Removed temporary
	  changes of system encoding because it does not allow to install
	  Tkabber to a directory, which name contains nonenglish
	  characters.

	* ckabber.tcl, tkabber.tcl: Removed temporary changes of
	  system encoding since [msgcat::mcload] and [option readfile]
	  themselves use UTF-8.


Modified: trunk/tkabber/ckabber.tcl
===================================================================
--- trunk/tkabber/ckabber.tcl	2006-10-05 20:48:19 UTC (rev 746)
+++ trunk/tkabber/ckabber.tcl	2006-10-05 21:23:51 UTC (rev 747)
@@ -79,8 +79,6 @@
     option readfile [fullpath ifaceck default.xrdb] startupFile
 }
 
-set sysenc [encoding system]
-encoding system utf-8
 ::msgcat::mcload [file join $rootdir msgs]
 foreach pr [::msgcat::mcpreferences] {
     set f [file join $rootdir msgs "$pr.rc"]
@@ -89,8 +87,7 @@
 	break
     }
 }
-encoding system $sysenc
-unset sysenc pr f
+unset pr f
 
 if {[catch { package require Tclx }]} {
     load_source Tclx.tcl

Modified: trunk/tkabber/plugins/general/headlines.tcl
===================================================================
--- trunk/tkabber/plugins/general/headlines.tcl	2006-10-05 20:48:19 UTC (rev 746)
+++ trunk/tkabber/plugins/general/headlines.tcl	2006-10-05 21:23:51 UTC (rev 747)
@@ -670,10 +670,12 @@
 
     if {$options(cache)} {
 	if {[file exists [set file [file join ~ .tkabber headlines.tcl]]]} {
-	    set encoding [encoding system]
-	    encoding system utf-8
-	    catch { source $file }
-	    encoding system $encoding
+	    catch {
+		set fd [open $file "r"]
+		fconfigure $fd -encoding utf-8
+		uplevel #0 [read $fd]
+		close $fd
+	    }
 	}
     }
 

Modified: trunk/tkabber/tkabber.tcl
===================================================================
--- trunk/tkabber/tkabber.tcl	2006-10-05 20:48:19 UTC (rev 746)
+++ trunk/tkabber/tkabber.tcl	2006-10-05 21:23:51 UTC (rev 747)
@@ -149,9 +149,7 @@
     }
 }
 
-set sysenc [encoding system]
-encoding system utf-8
-source [file join $rootdir trans.tcl]
+load_source trans.tcl
 ::trans::load [file join $rootdir trans]
 ::msgcat::mcload [file join $rootdir msgs]
 foreach pr [::msgcat::mcpreferences] {
@@ -168,8 +166,7 @@
 	break
     }
 }
-encoding system $sysenc
-unset sysenc pr f
+unset pr f
 
 if {[catch { package require Tclx }]} {
     load_source Tclx.tcl

Modified: trunk/tkabber/trans.tcl
===================================================================
--- trunk/tkabber/trans.tcl	2006-10-05 20:48:19 UTC (rev 746)
+++ trunk/tkabber/trans.tcl	2006-10-05 21:23:51 UTC (rev 747)
@@ -7,10 +7,10 @@
 }
 
 proc ::trans::loadfile {filepath} {
-    set saved_encoding [encoding system]
-    encoding system utf-8
-    uplevel #0 [list source $filepath]
-    encoding system $saved_encoding
+    set fd [open $filepath "r"]
+    fconfigure $fd -encoding utf-8
+    uplevel #0 [read $fd]
+    close $fd
 }
 
 proc ::trans::load {dirpath} {



More information about the Tkabber-dev mailing list