Skip to content

Commit

Permalink
Merge pull request #19 from EndPointCorp/fix/handle_unicode
Browse files Browse the repository at this point in the history
Fix UTF-8 serialization
  • Loading branch information
chris-smith authored Oct 10, 2019
2 parents 795dfc8 + fa33317 commit 779c415
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gennodejs/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def get_dynamic_field_length_line(field, query):
if not is_string(f.base_type):
raise Exception('Unexpected field {} with type {} has unknown length'.format(f.name, f.base_type))
# it's a string array!
line_to_write = 'length += 4 + val.length;'
line_to_write = 'length += 4 + _getByteLength(val);'
else:
(package, msg_type) = f.base_type.split('/')
samePackage = spec.package == package
Expand All @@ -618,7 +618,7 @@ def get_dynamic_field_length_line(field, query):
raise Exception('Unexpected field {} with type {} has unknown length'.format(f.name, f.base_type))
# it's a string array!
len_constant_length_fields += 4
line_to_write = 'length += object.{}.length;'.format(f.name)
line_to_write = 'length += _getByteLength(object.{});'.format(f.name)
else:
(package, msg_type) = f.base_type.split('/')
samePackage = spec.package == package
Expand Down

0 comments on commit 779c415

Please sign in to comment.