Skip to content

Commit 63c6e0e

Browse files
chfritzchris-smith
authored andcommitted
Fixes bug in on-the-fly message handling of unicode strings (#120)
* Fixes bug in on-the-fly message handling of unicode strings Fixes #119.
1 parent 49a80a6 commit 63c6e0e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/utils/messageGeneration/fields.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ fields.getPrimitiveSize = function(fieldType, fieldValue) {
283283
}
284284
else if (fieldType === 'string') {
285285
if (fieldValue !== undefined) {
286-
fieldSize = fieldValue.length + 4;
286+
fieldSize = Buffer.byteLength(fieldValue, 'utf8') + 4;
287287
}
288288
}
289289
else if (fieldType === 'time') {

0 commit comments

Comments
 (0)