• R/O
  • SSH
  • HTTPS

micle: Commit


Commit MetaInfo

Revision31 (tree)
Time2007-06-12 16:43:44
Authortohka

Log Message

baku: Micle::Configを修正。

Change Summary

Incremental Difference

--- micle/trunk/src/lib/micle/config.rb (revision 30)
+++ micle/trunk/src/lib/micle/config.rb (revision 31)
@@ -175,8 +175,8 @@
175175 self.validate(:html_encoding, String, 'Shift_JIS')
176176 self.validate(:csv_encoding, String, 'Shift_JIS')
177177 self.validate(:debug, FalseClass, false)
178- self.validate_encoding(:html_encoding, :he)
179- self.validate_encoding(:csv_encoding, :ce)
178+ self.validate_encoding(:html_encoding, :hencoding)
179+ self.validate_encoding(:csv_encoding, :cencoding)
180180 end
181181 def self.validate(key, klass, default=nil)
182182 if klass == TrueClass
@@ -307,7 +307,24 @@
307307 end
308308 end
309309 def self.validate_encoding(encoding, code)
310- nil
310+ case self[encoding].downcase
311+ when 'jis', 'iso-2022-jp'
312+ self[encoding] = 'iso-2022-jp'
313+ self[code] = Kconv::JIS
314+ when 'sjis', 'shift_jis'
315+ self[encoding] = 'Shift_JIS'
316+ self[code] = Kconv::SJIS
317+ when 'euc', 'euc-jp'
318+ self[encoding] = 'euc-jp'
319+ self[code] = Kconv::EUC
320+ when 'utf8', 'utf-8'
321+ self[encoding] = 'utf-8'
322+ self[code] = Kconv::UTF8
323+ else
324+ Log.cation("指定された文字コードは対応していません。")
325+ self[encoding] = 'Shift_JIS'
326+ self[code] = Kconv::SJIS
327+ end
311328 end
312329 def self.dump
313330 @config = Hash.new if @config.nil?
Show on old repository browser