pony-express 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/ext/mimetic.cxx +8 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.3
|
data/ext/mimetic.cxx
CHANGED
@@ -131,8 +131,10 @@ void rb_load_mime_types(VALUE self, VALUE filename) {
|
|
131
131
|
}
|
132
132
|
|
133
133
|
VALUE rb_mimetic_build(VALUE self, VALUE options) {
|
134
|
-
ostringstream output;
|
135
134
|
VALUE attachment;
|
135
|
+
ostringstream output;
|
136
|
+
rb_encoding* enc = 0;
|
137
|
+
|
136
138
|
VALUE text = rb_hash_aref(options, SYM("text"));
|
137
139
|
VALUE to = rb_hash_aref(options, SYM("to"));
|
138
140
|
VALUE from = rb_hash_aref(options, SYM("from"));
|
@@ -195,12 +197,14 @@ VALUE rb_mimetic_build(VALUE self, VALUE options) {
|
|
195
197
|
html_part->header().contentId(hcid == Qnil ? content_id() + ">" : ContentId(CSTRING(hcid)));
|
196
198
|
html_part->header().mimeVersion(v1);
|
197
199
|
html_part->body().assign(CSTRING(html));
|
200
|
+
enc = rb_enc_get(html);
|
198
201
|
}
|
199
202
|
else {
|
200
203
|
message->body().assign(CSTRING(text));
|
201
204
|
message->header().contentType("text/plain; charset=" + RUBY_ENCODING(text));
|
202
205
|
message->header().contentTransferEncoding("8bit");
|
203
206
|
message->header().mimeVersion(v1);
|
207
|
+
enc = rb_enc_get(text);
|
204
208
|
}
|
205
209
|
|
206
210
|
if (files != Qnil && RARRAY_LEN(files) > 0) {
|
@@ -240,7 +244,9 @@ VALUE rb_mimetic_build(VALUE self, VALUE options) {
|
|
240
244
|
|
241
245
|
output << *message << endl;
|
242
246
|
delete message;
|
243
|
-
|
247
|
+
|
248
|
+
string content = output.str();
|
249
|
+
return rb_enc_str_new(content.data(), content.size(), enc);
|
244
250
|
}
|
245
251
|
catch(exception &e) {
|
246
252
|
if (message) delete message;
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 8
|
8
|
-
-
|
9
|
-
version: 0.8.
|
8
|
+
- 3
|
9
|
+
version: 0.8.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Bharanee Rathna
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-05-12 00:00:00 +10:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|