Sha256: 02a061d5051a3c3c3740049af5aed728c11176feca5a1332d1a0d454f8dff513

Contents?: true

Size: 647 Bytes

Versions: 145

Compression:

Stored size: 647 Bytes

Contents

module REXML
  module Encoding
    begin
      require 'uconv'

      def decode_sjis content
        Uconv::sjistou8(content)
      end

      def encode_sjis(str)
        Uconv::u8tosjis(str)
      end
    rescue LoadError
      require 'nkf'

      SJISTOU8 = '-Swm0x'
      U8TOSJIS = '-Wsm0x'

      def decode_sjis(str)
        NKF.nkf(SJISTOU8, str)
      end

      def encode_sjis content
        NKF.nkf(U8TOSJIS, content)
      end
    end

    b = proc do |obj|
      class << obj
        alias decode decode_sjis
        alias encode encode_sjis
      end
    end
    register("SHIFT-JIS", &b)
    register("SHIFT_JIS", &b)
  end
end

Version data entries

145 entries across 145 versions & 5 rubygems

Version Path
rhodes-7.6.0 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-7.5.1 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-7.4.1 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-7.1.17 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-6.2.0 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-6.0.11 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-5.5.18 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-5.5.17 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-5.5.15 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-5.5.0.22 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-5.5.2 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-5.5.0.7 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-5.5.0.3 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rhodes-5.5.0 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
tauplatform-1.0.3 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
tauplatform-1.0.2 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
tauplatform-1.0.1 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb
rubysl-rexml-1.0.0 lib/rexml/encodings/SHIFT-JIS.rb
ruby_on_ruby-0.0.1 vendor/javascripts/emscripted-ruby/lib/rexml/encodings/SHIFT-JIS.rb
rhodes-3.5.1.12 lib/extensions/rexml/rexml/encodings/SHIFT-JIS.rb