jpmobile 5.2.3 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/.onkcop-config.yml +423 -0
- data/.rubocop.yml +8 -10
- data/.ruby-version +1 -1
- data/Gemfile +2 -2
- data/Gemfile.lock +155 -130
- data/README.md +2 -2
- data/jpmobile.gemspec +3 -1
- data/lib/jpmobile.rb +1 -0
- data/lib/jpmobile/emoticon.rb +6 -6
- data/lib/jpmobile/filter.rb +7 -2
- data/lib/jpmobile/hook_action_view.rb +4 -10
- data/lib/jpmobile/hook_test_request.rb +1 -1
- data/lib/jpmobile/mail.rb +3 -3
- data/lib/jpmobile/mobile/android.rb +1 -1
- data/lib/jpmobile/mobile/au.rb +2 -2
- data/lib/jpmobile/mobile/black_berry.rb +1 -1
- data/lib/jpmobile/mobile/ddipocket.rb +1 -1
- data/lib/jpmobile/mobile/docomo.rb +2 -2
- data/lib/jpmobile/mobile/emobile.rb +2 -2
- data/lib/jpmobile/mobile/ipad.rb +1 -1
- data/lib/jpmobile/mobile/iphone.rb +1 -1
- data/lib/jpmobile/mobile/softbank.rb +2 -2
- data/lib/jpmobile/mobile/vodafone.rb +2 -2
- data/lib/jpmobile/mobile/willcom.rb +2 -2
- data/lib/jpmobile/mobile/windows_phone.rb +1 -1
- data/lib/jpmobile/rails.rb +8 -6
- data/lib/jpmobile/resolver.rb +4 -37
- data/lib/jpmobile/session/active_record_store.rb +1 -1
- data/lib/jpmobile/session/mem_cache_store.rb +1 -1
- data/lib/jpmobile/trans_sid.rb +1 -1
- data/lib/jpmobile/util.rb +2 -2
- data/lib/jpmobile/version.rb +1 -1
- data/lib/tasks/jpmobile_tasks.rake +4 -4
- data/spec/rack/jpmobile/emoticon_spec.rb +48 -48
- data/spec/rack_helper.rb +1 -1
- data/spec/unit/receive_mail_spec.rb +9 -9
- data/spec/unit/util_spec.rb +4 -4
- data/test/rails/overrides/app/controllers/mobile_spec_controller.rb +1 -1
- data/test/rails/overrides/app/mailboxes/application_mailbox.rb +3 -0
- data/test/rails/overrides/app/mailboxes/mobile_mailer_mailbox.rb +5 -0
- data/test/rails/overrides/app/mailers/decorated_mailer.rb +1 -1
- data/test/rails/overrides/db/migrate/20201111033056_create_active_storage_tables.active_storage.rb +36 -0
- data/test/rails/overrides/db/migrate/20201111033057_create_action_mailbox_tables.action_mailbox.rb +14 -0
- data/test/rails/overrides/spec/controllers/hankaku_filter_controller_spec.rb +1 -1
- data/test/rails/overrides/spec/controllers/template_path_spec.rb +2 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/au-attached.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/au-decomail.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/au-emoji.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/au-emoji2.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/au-emoji5.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/bounced-jp.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/docomo-emoji.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/docomo-gmail-sjis.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/docomo-jis.eml +0 -0
- data/{spec/unit/email-fixtures → test/rails/overrides/spec/fixtures/files/mobile_mailer}/iphone-message.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/no-from.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/non-jp.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/photo.jpg +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/softbank-blank.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/softbank-emoji-utf8.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/softbank-emoji.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/softbank-gmail-sjis.eml +0 -0
- data/test/rails/overrides/spec/fixtures/{mobile_mailer → files/mobile_mailer}/softbank-gmail-utf8.eml +0 -0
- data/test/rails/overrides/spec/mailboxes/mobile_mailer_mailbox_spec.rb +265 -0
- data/test/rails/overrides/spec/mailers/mobile_mailer_spec.rb +0 -305
- data/test/rails/overrides/spec/requests/emobile_spec.rb +2 -2
- metadata +80 -42
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.2
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,193 +1,218 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
jpmobile (
|
4
|
+
jpmobile (6.0.0)
|
5
5
|
mail (~> 2.7.0)
|
6
|
+
rexml
|
7
|
+
scanf
|
6
8
|
|
7
9
|
GEM
|
8
10
|
remote: https://rubygems.org/
|
9
11
|
specs:
|
10
|
-
actioncable (
|
11
|
-
actionpack (=
|
12
|
+
actioncable (6.1.0)
|
13
|
+
actionpack (= 6.1.0)
|
14
|
+
activesupport (= 6.1.0)
|
12
15
|
nio4r (~> 2.0)
|
13
16
|
websocket-driver (>= 0.6.1)
|
14
|
-
|
15
|
-
actionpack (=
|
16
|
-
|
17
|
-
|
17
|
+
actionmailbox (6.1.0)
|
18
|
+
actionpack (= 6.1.0)
|
19
|
+
activejob (= 6.1.0)
|
20
|
+
activerecord (= 6.1.0)
|
21
|
+
activestorage (= 6.1.0)
|
22
|
+
activesupport (= 6.1.0)
|
23
|
+
mail (>= 2.7.1)
|
24
|
+
actionmailer (6.1.0)
|
25
|
+
actionpack (= 6.1.0)
|
26
|
+
actionview (= 6.1.0)
|
27
|
+
activejob (= 6.1.0)
|
28
|
+
activesupport (= 6.1.0)
|
18
29
|
mail (~> 2.5, >= 2.5.4)
|
19
30
|
rails-dom-testing (~> 2.0)
|
20
|
-
actionpack (
|
21
|
-
actionview (=
|
22
|
-
activesupport (=
|
23
|
-
rack (~> 2.0)
|
31
|
+
actionpack (6.1.0)
|
32
|
+
actionview (= 6.1.0)
|
33
|
+
activesupport (= 6.1.0)
|
34
|
+
rack (~> 2.0, >= 2.0.9)
|
24
35
|
rack-test (>= 0.6.3)
|
25
36
|
rails-dom-testing (~> 2.0)
|
26
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
27
|
-
|
28
|
-
|
37
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
38
|
+
actiontext (6.1.0)
|
39
|
+
actionpack (= 6.1.0)
|
40
|
+
activerecord (= 6.1.0)
|
41
|
+
activestorage (= 6.1.0)
|
42
|
+
activesupport (= 6.1.0)
|
43
|
+
nokogiri (>= 1.8.5)
|
44
|
+
actionview (6.1.0)
|
45
|
+
activesupport (= 6.1.0)
|
29
46
|
builder (~> 3.1)
|
30
47
|
erubi (~> 1.4)
|
31
48
|
rails-dom-testing (~> 2.0)
|
32
|
-
rails-html-sanitizer (~> 1.
|
33
|
-
activejob (
|
34
|
-
activesupport (=
|
49
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
50
|
+
activejob (6.1.0)
|
51
|
+
activesupport (= 6.1.0)
|
35
52
|
globalid (>= 0.3.6)
|
36
|
-
activemodel (
|
37
|
-
activesupport (=
|
38
|
-
activerecord (
|
39
|
-
activemodel (=
|
40
|
-
activesupport (=
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
activerecord (=
|
53
|
+
activemodel (6.1.0)
|
54
|
+
activesupport (= 6.1.0)
|
55
|
+
activerecord (6.1.0)
|
56
|
+
activemodel (= 6.1.0)
|
57
|
+
activesupport (= 6.1.0)
|
58
|
+
activestorage (6.1.0)
|
59
|
+
actionpack (= 6.1.0)
|
60
|
+
activejob (= 6.1.0)
|
61
|
+
activerecord (= 6.1.0)
|
62
|
+
activesupport (= 6.1.0)
|
45
63
|
marcel (~> 0.3.1)
|
46
|
-
|
64
|
+
mimemagic (~> 0.3.2)
|
65
|
+
activesupport (6.1.0)
|
47
66
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
48
|
-
i18n (>=
|
49
|
-
minitest (
|
50
|
-
tzinfo (~>
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
ast (2.4.
|
55
|
-
builder (3.2.
|
56
|
-
capybara (3.0
|
67
|
+
i18n (>= 1.6, < 2)
|
68
|
+
minitest (>= 5.1)
|
69
|
+
tzinfo (~> 2.0)
|
70
|
+
zeitwerk (~> 2.3)
|
71
|
+
addressable (2.7.0)
|
72
|
+
public_suffix (>= 2.0.2, < 5.0)
|
73
|
+
ast (2.4.1)
|
74
|
+
builder (3.2.4)
|
75
|
+
capybara (3.34.0)
|
57
76
|
addressable
|
58
77
|
mini_mime (>= 0.1.3)
|
59
78
|
nokogiri (~> 1.8)
|
60
79
|
rack (>= 1.6.0)
|
61
80
|
rack-test (>= 0.6.3)
|
62
|
-
|
63
|
-
|
81
|
+
regexp_parser (~> 1.5)
|
82
|
+
xpath (~> 3.2)
|
83
|
+
capybara-webkit (1.15.1)
|
64
84
|
capybara (>= 2.3, < 4.0)
|
65
85
|
json
|
66
|
-
coderay (1.1.
|
67
|
-
concurrent-ruby (1.1.
|
68
|
-
crass (1.0.
|
69
|
-
diff-lcs (1.
|
70
|
-
erubi (1.
|
71
|
-
geokit (1.
|
72
|
-
git (1.
|
73
|
-
|
86
|
+
coderay (1.1.3)
|
87
|
+
concurrent-ruby (1.1.7)
|
88
|
+
crass (1.0.6)
|
89
|
+
diff-lcs (1.4.4)
|
90
|
+
erubi (1.10.0)
|
91
|
+
geokit (1.13.1)
|
92
|
+
git (1.7.0)
|
93
|
+
rchardet (~> 1.8)
|
94
|
+
globalid (0.4.2)
|
74
95
|
activesupport (>= 4.2.0)
|
75
96
|
hpricot (0.8.6)
|
76
|
-
i18n (1.
|
97
|
+
i18n (1.8.5)
|
77
98
|
concurrent-ruby (~> 1.0)
|
78
|
-
|
79
|
-
|
99
|
+
jaro_winkler (1.5.4)
|
100
|
+
json (2.3.1)
|
101
|
+
loofah (2.8.0)
|
80
102
|
crass (~> 1.0.2)
|
81
103
|
nokogiri (>= 1.5.9)
|
82
104
|
mail (2.7.1)
|
83
105
|
mini_mime (>= 0.1.1)
|
84
106
|
marcel (0.3.3)
|
85
107
|
mimemagic (~> 0.3.2)
|
86
|
-
method_source (0.
|
87
|
-
mimemagic (0.3.
|
88
|
-
mini_mime (1.0.
|
89
|
-
mini_portile2 (2.
|
90
|
-
minitest (5.
|
91
|
-
nio4r (2.
|
92
|
-
nokogiri (1.
|
93
|
-
mini_portile2 (~> 2.
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
coderay (~> 1.1.0)
|
103
|
-
method_source (~> 0.9.0)
|
104
|
-
public_suffix (3.0.2)
|
105
|
-
rack (2.0.6)
|
108
|
+
method_source (1.0.0)
|
109
|
+
mimemagic (0.3.5)
|
110
|
+
mini_mime (1.0.2)
|
111
|
+
mini_portile2 (2.4.0)
|
112
|
+
minitest (5.14.2)
|
113
|
+
nio4r (2.5.4)
|
114
|
+
nokogiri (1.10.10)
|
115
|
+
mini_portile2 (~> 2.4.0)
|
116
|
+
parallel (1.20.1)
|
117
|
+
parser (2.7.2.0)
|
118
|
+
ast (~> 2.4.1)
|
119
|
+
pry (0.13.1)
|
120
|
+
coderay (~> 1.1)
|
121
|
+
method_source (~> 1.0)
|
122
|
+
public_suffix (4.0.6)
|
123
|
+
rack (2.2.3)
|
106
124
|
rack-test (1.1.0)
|
107
125
|
rack (>= 1.0, < 3)
|
108
|
-
rails (
|
109
|
-
actioncable (=
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
126
|
+
rails (6.1.0)
|
127
|
+
actioncable (= 6.1.0)
|
128
|
+
actionmailbox (= 6.1.0)
|
129
|
+
actionmailer (= 6.1.0)
|
130
|
+
actionpack (= 6.1.0)
|
131
|
+
actiontext (= 6.1.0)
|
132
|
+
actionview (= 6.1.0)
|
133
|
+
activejob (= 6.1.0)
|
134
|
+
activemodel (= 6.1.0)
|
135
|
+
activerecord (= 6.1.0)
|
136
|
+
activestorage (= 6.1.0)
|
137
|
+
activesupport (= 6.1.0)
|
138
|
+
bundler (>= 1.15.0)
|
139
|
+
railties (= 6.1.0)
|
120
140
|
sprockets-rails (>= 2.0.0)
|
121
141
|
rails-dom-testing (2.0.3)
|
122
142
|
activesupport (>= 4.2.0)
|
123
143
|
nokogiri (>= 1.6)
|
124
|
-
rails-html-sanitizer (1.0
|
125
|
-
loofah (~> 2.
|
126
|
-
railties (
|
127
|
-
actionpack (=
|
128
|
-
activesupport (=
|
144
|
+
rails-html-sanitizer (1.3.0)
|
145
|
+
loofah (~> 2.3)
|
146
|
+
railties (6.1.0)
|
147
|
+
actionpack (= 6.1.0)
|
148
|
+
activesupport (= 6.1.0)
|
129
149
|
method_source
|
130
150
|
rake (>= 0.8.7)
|
131
|
-
thor (
|
151
|
+
thor (~> 1.0)
|
132
152
|
rainbow (3.0.0)
|
133
|
-
rake (
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
rspec-
|
140
|
-
|
153
|
+
rake (13.0.1)
|
154
|
+
rchardet (1.8.0)
|
155
|
+
regexp_parser (1.8.2)
|
156
|
+
rexml (3.2.4)
|
157
|
+
rspec (3.10.0)
|
158
|
+
rspec-core (~> 3.10.0)
|
159
|
+
rspec-expectations (~> 3.10.0)
|
160
|
+
rspec-mocks (~> 3.10.0)
|
161
|
+
rspec-core (3.10.0)
|
162
|
+
rspec-support (~> 3.10.0)
|
163
|
+
rspec-expectations (3.10.0)
|
141
164
|
diff-lcs (>= 1.2.0, < 2.0)
|
142
|
-
rspec-support (~> 3.
|
143
|
-
rspec-its (1.
|
165
|
+
rspec-support (~> 3.10.0)
|
166
|
+
rspec-its (1.3.0)
|
144
167
|
rspec-core (>= 3.0.0)
|
145
168
|
rspec-expectations (>= 3.0.0)
|
146
|
-
rspec-mocks (3.
|
169
|
+
rspec-mocks (3.10.0)
|
147
170
|
diff-lcs (>= 1.2.0, < 2.0)
|
148
|
-
rspec-support (~> 3.
|
149
|
-
rspec-rails (
|
150
|
-
actionpack (>=
|
151
|
-
activesupport (>=
|
152
|
-
railties (>=
|
153
|
-
rspec-core (~> 3.
|
154
|
-
rspec-expectations (~> 3.
|
155
|
-
rspec-mocks (~> 3.
|
156
|
-
rspec-support (~> 3.
|
157
|
-
rspec-support (3.
|
158
|
-
rubocop (0.
|
171
|
+
rspec-support (~> 3.10.0)
|
172
|
+
rspec-rails (4.0.1)
|
173
|
+
actionpack (>= 4.2)
|
174
|
+
activesupport (>= 4.2)
|
175
|
+
railties (>= 4.2)
|
176
|
+
rspec-core (~> 3.9)
|
177
|
+
rspec-expectations (~> 3.9)
|
178
|
+
rspec-mocks (~> 3.9)
|
179
|
+
rspec-support (~> 3.9)
|
180
|
+
rspec-support (3.10.0)
|
181
|
+
rubocop (0.79.0)
|
182
|
+
jaro_winkler (~> 1.5.1)
|
159
183
|
parallel (~> 1.10)
|
160
|
-
parser (>= 2.
|
161
|
-
powerpack (~> 0.1)
|
184
|
+
parser (>= 2.7.0.1)
|
162
185
|
rainbow (>= 2.2.2, < 4.0)
|
163
186
|
ruby-progressbar (~> 1.7)
|
164
|
-
unicode-display_width (
|
165
|
-
rubocop-
|
166
|
-
rubocop (>= 0.
|
167
|
-
ruby-progressbar (1.
|
168
|
-
|
187
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
188
|
+
rubocop-performance (1.5.2)
|
189
|
+
rubocop (>= 0.71.0)
|
190
|
+
ruby-progressbar (1.10.1)
|
191
|
+
scanf (1.0.0)
|
192
|
+
sprockets (4.0.2)
|
169
193
|
concurrent-ruby (~> 1.0)
|
170
194
|
rack (> 1, < 3)
|
171
|
-
sprockets-rails (3.2.
|
195
|
+
sprockets-rails (3.2.2)
|
172
196
|
actionpack (>= 4.0)
|
173
197
|
activesupport (>= 4.0)
|
174
198
|
sprockets (>= 3.0.0)
|
175
|
-
sqlite3 (1.
|
199
|
+
sqlite3 (1.4.2)
|
176
200
|
sqlite3-ruby (1.3.3)
|
177
201
|
sqlite3 (>= 1.3.3)
|
178
|
-
thor (0.
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
websocket-driver (0.7.0)
|
202
|
+
thor (1.0.1)
|
203
|
+
tzinfo (2.0.3)
|
204
|
+
concurrent-ruby (~> 1.0)
|
205
|
+
unicode-display_width (1.6.1)
|
206
|
+
websocket-driver (0.7.3)
|
184
207
|
websocket-extensions (>= 0.1.0)
|
185
|
-
websocket-extensions (0.1.
|
186
|
-
xpath (3.
|
208
|
+
websocket-extensions (0.1.5)
|
209
|
+
xpath (3.2.0)
|
187
210
|
nokogiri (~> 1.8)
|
211
|
+
zeitwerk (2.4.2)
|
188
212
|
|
189
213
|
PLATFORMS
|
190
214
|
ruby
|
215
|
+
x86_64-darwin-19
|
191
216
|
|
192
217
|
DEPENDENCIES
|
193
218
|
capybara-webkit
|
@@ -195,14 +220,14 @@ DEPENDENCIES
|
|
195
220
|
git
|
196
221
|
hpricot
|
197
222
|
jpmobile!
|
198
|
-
onkcop
|
199
223
|
pry
|
200
|
-
rails (~>
|
224
|
+
rails (~> 6.1.0)
|
201
225
|
rspec
|
202
226
|
rspec-its
|
203
227
|
rspec-rails
|
204
|
-
rubocop
|
228
|
+
rubocop (= 0.79.0)
|
229
|
+
rubocop-performance (= 1.5.2)
|
205
230
|
sqlite3-ruby
|
206
231
|
|
207
232
|
BUNDLED WITH
|
208
|
-
|
233
|
+
2.2.2
|
data/README.md
CHANGED
@@ -316,7 +316,7 @@ end
|
|
316
316
|
|
317
317
|
```ruby
|
318
318
|
<%= get_position_link_to("位置情報を取得する", :action=>:gps) %>
|
319
|
-
```
|
319
|
+
```
|
320
320
|
|
321
321
|
### セッションIDの付与(Trans SID)
|
322
322
|
#### Cookie非対応携帯だけに付与する
|
@@ -353,7 +353,7 @@ Rails.application.config.session_options = {:cookie_only => false}
|
|
353
353
|
|
354
354
|
```ruby
|
355
355
|
link_to "hoge", "/controller/action/id"
|
356
|
-
```
|
356
|
+
```
|
357
357
|
|
358
358
|
のようにリンク先を直接指定するとセッションIDは付加されません。
|
359
359
|
|
data/jpmobile.gemspec
CHANGED
@@ -17,12 +17,14 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.require_paths = ['lib']
|
18
18
|
|
19
19
|
gem.add_dependency 'mail', '~> 2.7.0'
|
20
|
+
gem.add_dependency 'scanf'
|
21
|
+
gem.add_dependency 'rexml'
|
20
22
|
gem.add_development_dependency 'capybara-webkit'
|
21
23
|
gem.add_development_dependency 'geokit'
|
22
24
|
gem.add_development_dependency 'git'
|
23
25
|
gem.add_development_dependency 'hpricot'
|
24
26
|
gem.add_development_dependency 'pry'
|
25
|
-
gem.add_development_dependency 'rails', '~>
|
27
|
+
gem.add_development_dependency 'rails', '~> 6.1.0'
|
26
28
|
gem.add_development_dependency 'rspec'
|
27
29
|
gem.add_development_dependency 'rspec-its'
|
28
30
|
gem.add_development_dependency 'rspec-rails'
|
data/lib/jpmobile.rb
CHANGED
data/lib/jpmobile/emoticon.rb
CHANGED
@@ -41,7 +41,7 @@ module Jpmobile
|
|
41
41
|
# +str+ のなかでDoCoMo絵文字をUnicode数値文字参照に置換した文字列を返す。
|
42
42
|
def self.external_to_unicodecr_docomo(str)
|
43
43
|
str.gsub(DOCOMO_SJIS_REGEXP) do |match|
|
44
|
-
sjis = match.
|
44
|
+
sjis = match.unpack1('n')
|
45
45
|
unicode = DOCOMO_SJIS_TO_UNICODE[sjis]
|
46
46
|
unicode ? ('&#x%04x;' % unicode) : match
|
47
47
|
end
|
@@ -50,7 +50,7 @@ module Jpmobile
|
|
50
50
|
# +str+ のなかでau絵文字をUnicode数値文字参照に置換した文字列を返す。
|
51
51
|
def self.external_to_unicodecr_au(str)
|
52
52
|
str.gsub(AU_SJIS_REGEXP) do |match|
|
53
|
-
sjis = match.
|
53
|
+
sjis = match.unpack1('n')
|
54
54
|
unicode = AU_SJIS_TO_UNICODE[sjis]
|
55
55
|
unicode ? ('&#x%04x;' % unicode) : match
|
56
56
|
end
|
@@ -61,7 +61,7 @@ module Jpmobile
|
|
61
61
|
str = Jpmobile::Util.ascii_8bit(in_str)
|
62
62
|
str.gsub(Jpmobile::Util.jis_string_regexp) do |jis_string|
|
63
63
|
jis_string.gsub(/[\x21-\x7e]{2}/) do |match|
|
64
|
-
jis = match.
|
64
|
+
jis = match.unpack1('n')
|
65
65
|
unicode = AU_EMAILJIS_TO_UNICODE[jis]
|
66
66
|
unicode ? Jpmobile::Util.ascii_8bit("\x1b\x28\x42&#x%04x;\x1b\x24\x42" % unicode) : match
|
67
67
|
end
|
@@ -72,7 +72,7 @@ module Jpmobile
|
|
72
72
|
def self.external_to_unicodecr_softbank(str)
|
73
73
|
# SoftBank Unicode
|
74
74
|
str.gsub(SOFTBANK_UNICODE_REGEXP) do |match|
|
75
|
-
unicode = match.
|
75
|
+
unicode = match.unpack1('U')
|
76
76
|
'&#x%04x;' % (unicode + 0x1000)
|
77
77
|
end
|
78
78
|
end
|
@@ -80,7 +80,7 @@ module Jpmobile
|
|
80
80
|
def self.external_to_unicodecr_softbank_sjis(str)
|
81
81
|
# SoftBank Shift_JIS
|
82
82
|
str.gsub(SOFTBANK_SJIS_REGEXP) do |match|
|
83
|
-
sjis = match.
|
83
|
+
sjis = match.unpack1('n')
|
84
84
|
unicode = SOFTBANK_SJIS_TO_UNICODE[sjis]
|
85
85
|
'&#x%04x;' % (unicode + 0x1000)
|
86
86
|
end
|
@@ -209,7 +209,7 @@ module Jpmobile
|
|
209
209
|
# +str+ のなかでUTF-8で表記された絵文字をUnicode数値文字参照に置換する。
|
210
210
|
def self.utf8_to_unicodecr(str)
|
211
211
|
str.gsub(UTF8_REGEXP) do |match|
|
212
|
-
'&#x%04x;' % match.
|
212
|
+
'&#x%04x;' % match.unpack1('U')
|
213
213
|
end
|
214
214
|
end
|
215
215
|
|