From bc8b42fc1eb3f1adf9d170dc353a33f53bdab92f Mon Sep 17 00:00:00 2001 From: nagai Date: Thu, 31 Jul 2003 23:04:45 +0000 Subject: * bug fix : wrong resource file format (resource.{en,jp}) * add Tk::Encoding.{encoding_convertfrom, encoding_convertto} * add TkOptionDB.read_with_encoding to read non-utf8 resource file git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/sample/resource.en | 6 +++--- ext/tk/sample/resource.ja | 6 +++--- ext/tk/sample/tkoptdb.rb | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'ext/tk/sample') diff --git a/ext/tk/sample/resource.en b/ext/tk/sample/resource.en index 29bd587ea2..bfdc809278 100644 --- a/ext/tk/sample/resource.en +++ b/ext/tk/sample/resource.en @@ -1,6 +1,6 @@ -# -# see Tcl/Tk's "options" manual for "Database Name" and "Database Class" -# +! +! see Tcl/Tk's "options" manual for "Database Name" and "Database Class" +! *BtnFrame.borderWidth: 5 *BtnFrame.relief: ridge *BtnFrame.Button.background: wheat diff --git a/ext/tk/sample/resource.ja b/ext/tk/sample/resource.ja index 61098db4f8..8b715f36b0 100644 --- a/ext/tk/sample/resource.ja +++ b/ext/tk/sample/resource.ja @@ -1,6 +1,6 @@ -# -# see Tcl/Tk's "options" manual for "Database Name" and "Database Class" -# +! +! see Tcl/Tk's "options" manual for "Database Name" and "Database Class" +! *BtnFrame.borderWidth: 5 *BtnFrame.relief: ridge *BtnFrame.Button.background: wheat diff --git a/ext/tk/sample/tkoptdb.rb b/ext/tk/sample/tkoptdb.rb index 066bd9501a..6cb3d17993 100644 --- a/ext/tk/sample/tkoptdb.rb +++ b/ext/tk/sample/tkoptdb.rb @@ -10,7 +10,9 @@ require "tk" if ENV['LANG'] =~ /^ja/ # read Japanese resource - TkOptionDB.readfile(File.expand_path('resource.ja', File.dirname(__FILE__))) + TkOptionDB.read_with_encoding(File.expand_path('resource.ja', + File.dirname(__FILE__)), + 'euc-jp') else # read English resource TkOptionDB.readfile(File.expand_path('resource.en', File.dirname(__FILE__))) -- cgit v1.2.3