baku: Micle::Configを修正。
| @@ -175,8 +175,8 @@ | ||
| 175 | 175 | self.validate(:html_encoding, String, 'Shift_JIS') |
| 176 | 176 | self.validate(:csv_encoding, String, 'Shift_JIS') |
| 177 | 177 | 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) | |
| 180 | 180 | end |
| 181 | 181 | def self.validate(key, klass, default=nil) |
| 182 | 182 | if klass == TrueClass |
| @@ -307,7 +307,24 @@ | ||
| 307 | 307 | end |
| 308 | 308 | end |
| 309 | 309 | 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 | |
| 311 | 328 | end |
| 312 | 329 | def self.dump |
| 313 | 330 | @config = Hash.new if @config.nil? |