Skip to content

Commit

Permalink
Manually merge pull request for PDU encoding
Browse files Browse the repository at this point in the history
farhadi@a2b76cd?utf8=%E2%9C%93&diff=unified

This merges that pull request on the original project.
  • Loading branch information
craigify authored Nov 14, 2018
1 parent 1da445d commit d7a5d65
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,21 @@ filters.message = {
}
var message = typeof value == 'string' ? value : value.message;
if (typeof message == 'string') {
var encoding = encodings.detect(message);
if (message && this.data_coding === null) {
if (message) {
var encoding = encodings.default;
if (this.data_coding === null) {
encoding = encodings.detect(message);
} else {
for (var key in consts.ENCODING) {
if (consts.ENCODING[key] === this.data_coding) {
encoding = key;
break;
}
}
}
this.data_coding = consts.ENCODING[encoding];
message = encodings[encoding].encode(message);
}
message = encodings[encoding].encode(message);
}
if (!value.udh || !value.udh.length) {
return message;
Expand Down

0 comments on commit d7a5d65

Please sign in to comment.