Sha256: e963d6169bea298c458676def3862df49be62e5765805bbfc0b7557688e9c8fc

Contents?: true

Size: 984 Bytes

Versions: 16

Compression:

Stored size: 984 Bytes

Contents

# -*- coding: utf-8 -*-
# =iPhone

module Jpmobile::Mobile
  # ==iPhone
  class Iphone < SmartPhone
    # 対応するUser-Agentの正規表現
    USER_AGENT_REGEXP = /iPhone/

    # Jpmobile::Rack::Filter を適用する
    def apply_filter?
      true
    end

    # Jpmobile::Rack::ParamsFilter を適用する
    def apply_params_filter?
      true
    end

    # 文字コード変換
    def to_internal(str)
      # 絵文字を数値参照に変換
      str = Jpmobile::Emoticon.external_to_unicodecr_softbank(Jpmobile::Util.utf8(str))
      # 数値参照を UTF-8 に変換
      Jpmobile::Emoticon.unicodecr_to_utf8(str)
    end
    def to_external(str, content_type, charset)
      # UTF-8を数値参照に
      str = Jpmobile::Emoticon.utf8_to_unicodecr(str)
      # 数値参照を絵文字コードに変換
      str = Jpmobile::Emoticon.unicodecr_to_external(str, Jpmobile::Emoticon::CONVERSION_TABLE_TO_SOFTBANK, false)

      [str, charset]
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
jpmobile-1.0.9 lib/jpmobile/mobile/iphone.rb
jpmobile-2.0.8 lib/jpmobile/mobile/iphone.rb
jpmobile-3.0.4 lib/jpmobile/mobile/iphone.rb
jpmobile-3.0.3 lib/jpmobile/mobile/iphone.rb
jpmobile-3.0.2 lib/jpmobile/mobile/iphone.rb
jpmobile-3.0.1 lib/jpmobile/mobile/iphone.rb
jpmobile-2.0.7 lib/jpmobile/mobile/iphone.rb
jpmobile-2.0.6 lib/jpmobile/mobile/iphone.rb
jpmobile-3.0.0 lib/jpmobile/mobile/iphone.rb
jpmobile-2.0.5 lib/jpmobile/mobile/iphone.rb
jpmobile-1.0.8 lib/jpmobile/mobile/iphone.rb
jpmobile-2.0.4 lib/jpmobile/mobile/iphone.rb
jpmobile-2.0.3 lib/jpmobile/mobile/iphone.rb
jpmobile-1.0.7 lib/jpmobile/mobile/iphone.rb
jpmobile-1.0.6 lib/jpmobile/mobile/iphone.rb
jpmobile-2.0.2 lib/jpmobile/mobile/iphone.rb