CDMA 1X, CDMA 1X WINを含む。
GPS取得に対応していないデバイスID
簡易位置情報取得に対応していないデバイスID www.au.kddi.com/ezfactory/tec/spec/eznavi.html
対応するメールアドレスの正規表現
対応するUser-Agentの正規表現 User-Agent文字列中に "UP.Browser" を含むVodafoneの端末があるので注意が必要
# File lib/jpmobile/mobile/au.rb, line 120 def decoratable? true end
# File lib/jpmobile/mobile/au.rb, line 102 def default_charset "Shift_JIS" end
デバイスIDを返す
# File lib/jpmobile/mobile/au.rb, line 52 def device_id if @request.env['HTTP_USER_AGENT'] =~ USER_AGENT_REGEXP return $1 else nil end end
位置情報があれば Position のインスタンスを返す。無ければ nil を返す。
# File lib/jpmobile/mobile/au.rb, line 25 def position return @__posotion if defined? @__posotion return @__posotion = nil if ( params["lat"].nil? || params['lat'] == '' || params["lon"].nil? || params["lon"] == '' ) l = Jpmobile::Position.new l.options = params.reject {|x,v| !["ver", "datum", "unit", "lat", "lon", "alt", "time", "smaj", "smin", "vert", "majaa", "fm"].include?(x) } case params["unit"] when "1" l.lat = params["lat"].to_f l.lon = params["lon"].to_f when "0", "dms" raise "Invalid dms form" unless params["lat"] =~ /^([+-]?\d+)\.(\d+)\.(\d+\.\d+)$/ l.lat = Jpmobile::Position.dms2deg($1,$2,$3) raise "Invalid dms form" unless params["lon"] =~ /^([+-]?\d+)\.(\d+)\.(\d+\.\d+)$/ l.lon = Jpmobile::Position.dms2deg($1,$2,$3) else return @__posotion = nil end if params["datum"] == "1" # ただし、params["datum"]=="tokyo"のとき(簡易位置情報)のときは、 # 実際にはWGS84系のデータが渡ってくる # http://www.au.kddi.com/ezfactory/tec/spec/eznavi.html l.tokyo2wgs84! end return @__posotion = l end
EZ番号(サブスクライバID)があれば返す。無ければ nil を返す。
# File lib/jpmobile/mobile/au.rb, line 19 def subno @request.env["HTTP_X_UP_SUBNO"] end
GPS位置情報取得に対応している場合は true を返す。
# File lib/jpmobile/mobile/au.rb, line 66 def supports_gps? ! GPS_UNSUPPORTED_DEVICE_ID.include?(device_id) end
簡易位置情報取得に対応している場合は true を返す。
# File lib/jpmobile/mobile/au.rb, line 61 def supports_location? ! LOCATION_UNSUPPORTED_DEVICE_ID.include?(device_id) end
# File lib/jpmobile/mobile/au.rb, line 89 def to_external(str, content_type, charset) # UTF-8を数値参照に str = Jpmobile::Emoticon.utf8_to_unicodecr(str) # 文字コードを Shift_JIS に変換 if [nil, "text/html", "application/xhtml+xml"].include?(content_type) str = Jpmobile::Util.utf8_to_sjis(str) charset = default_charset unless str.empty? end # 数値参照を絵文字コードに変換 str = Jpmobile::Emoticon.unicodecr_to_external(str, Jpmobile::Emoticon::CONVERSION_TABLE_TO_AU, true) [str, charset] end
文字コード変換
# File lib/jpmobile/mobile/au.rb, line 81 def to_internal(str) # 絵文字を数値参照に変換 str = Jpmobile::Emoticon.external_to_unicodecr_au(Jpmobile::Util.sjis(str)) # 文字コードを UTF-8 に変換 str = Jpmobile::Util.sjis_to_utf8(str) # 数値参照を UTF-8 に変換 Jpmobile::Emoticon::unicodecr_to_utf8(str) end
メール送信用
# File lib/jpmobile/mobile/au.rb, line 107 def to_mail_body(str) to_mail_encoding(str) end
# File lib/jpmobile/mobile/au.rb, line 111 def to_mail_internal(str, charset) if Jpmobile::Util.jis?(str) or Jpmobile::Util.ascii_8bit?(str) or charset == mail_charset # 絵文字を数値参照に変換 str = Jpmobile::Emoticon.external_to_unicodecr_au_mail(Jpmobile::Util.jis(str)) str = Jpmobile::Util.jis_to_utf8(Jpmobile::Util.jis(str)) end str end
Generated with the Darkfish Rdoc Generator 2.