summaryrefslogtreecommitdiff
path: root/ext/tk/sample
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-31 23:04:45 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-31 23:04:45 +0000
commitbc8b42fc1eb3f1adf9d170dc353a33f53bdab92f (patch)
tree197128d19a69a4d98898914df795f35c2aa631bc /ext/tk/sample
parent75362fbd47cedf4b4906a361a6c54bc4ad8ea5ec (diff)
* 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
Diffstat (limited to 'ext/tk/sample')
-rw-r--r--ext/tk/sample/resource.en6
-rw-r--r--ext/tk/sample/resource.ja6
-rw-r--r--ext/tk/sample/tkoptdb.rb4
3 files changed, 9 insertions, 7 deletions
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__)))