Sha256: 12b518bddf8662ac32f1149579f6ead999f7171d1b520c0d08adf2628f053cf3
Contents?: true
Size: 752 Bytes
Versions: 1
Compression:
Stored size: 752 Bytes
Contents
module Md2site module Nkfguess require "nkf" def self.guess_file(fname, mes) str = nil mes.exc_file_read(fname) { File.open(fname) {|f| str = f.gets(nil) } } if str.nil? encoding = nil else case NKF.guess(str) when NKF::JIS encoding = "ISO-2022-JP" when NKF::EUC encoding = "eucJP" when NKF::SJIS encoding = "CP932" when NKF::UTF8 encoding = "UTF-8" when NKF::BINARY encoding = "ASCII-8BIT" when NKF::ASCII encoding = "ASCII-8BIT" when NKF::UNKNOWN encoding = "ASCII-8BIT" else encoding = "ASCII-8BIT" end end encoding end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
md2site-0.1.2 | lib/md2site/nkfguess.rb |