Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
squash! wrap long line
  • Loading branch information
refack committed Jun 1, 2019
commit b2d35a39732e66a34d6fd0036fcb0ce489bc83bd
5 changes: 4 additions & 1 deletion tools/js2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ def GetDefinition(var, source, step=30):
template = TWO_BYTE_STRING
# Treat non-ASCII as UTF-8 and encode as UTF-16 Little Endian.
encoded_source = bytearray(source, 'utf-16le')
code_points = [encoded_source[i] + (encoded_source[i + 1] * 256) for i in range(0, len(encoded_source), 2)]
code_points = [
encoded_source[i] + (encoded_source[i + 1] * 256)
for i in range(0, len(encoded_source), 2)
]

# For easier debugging, align to the common 3 char for code-points.
elements_s = ['%3s' % x for x in code_points]
Expand Down