From 9b64d7d3cd89cbd7f7ba7b73d4d8d31d507fc4f7 Mon Sep 17 00:00:00 2001 From: Boris Honman Date: Tue, 11 Feb 2020 14:20:14 -0500 Subject: [PATCH] added unicode output in string generator script --- genDescriptorString.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/genDescriptorString.py b/genDescriptorString.py index 7017b13..7b59964 100644 --- a/genDescriptorString.py +++ b/genDescriptorString.py @@ -6,11 +6,17 @@ if not len(sys.argv) > 1: exit(0) instr = ' '.join(sys.argv[1:]) -count = 0 +count = len(instr) print('') +print(f"num characters: {count}") +print('## ASCII ##') +print(f"size: {count} bytes") for c in instr: print(f"'{c}',", end='') - count += 1 print('') -print(f"size: {count}") -print('') \ No newline at end of file +print('') +print('## Unicode ##') +print(f"size: {count*2} bytes") +for c in instr: + print(f"'{c}',\t0x00U,") + count += 1 \ No newline at end of file