Sunday, December 27, 2009

Refe

require 'nkf'
require 'iconv'

module ReFe

  module Encoding

    def adjust_encoding( str )
      if shift_jis_platform?
        NKF.nkf('-Es', str)
      else
        Iconv::iconv("UTF-8", "EUC-JP", str)
      end
    end

No comments: