From 540ccf656a2b8f603a90727be06b0f990cbe46e2 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Mon, 9 Oct 2017 09:10:21 -0600 Subject: scripts: Handle goofy unicode chars in spec.py Forward and backward double-quotes are now changed to standard double-quote chars, and escaped as they are output in the DB. Change-Id: Icbdc23262c8da0dd2441b028997a3f30d69d6834 --- scripts/spec.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/spec.py b/scripts/spec.py index de346320..3c02dfe6 100644 --- a/scripts/spec.py +++ b/scripts/spec.py @@ -139,6 +139,8 @@ class Specification: just_txt = just_txt.get_text().strip() unicode_map = { u"\u2019" : "'", + u"\u201c" : "\"", + u"\u201d" : "\"", u"\u2192" : "->", } for um in unicode_map: @@ -228,7 +230,7 @@ class Specification: enum_value = vuid_mapping.convertVUID(vuid_str) new_enum = "%s%s" % (validation_error_enum_name, get8digithex(enum_value)) enum_decl.append(' %s = 0x%s,' % (new_enum, get8digithex(enum_value))) - error_string_map.append(' {%s, "%s"},' % (new_enum, self.error_db_dict[enum]['error_msg'])) + error_string_map.append(' {%s, "%s"},' % (new_enum, self.error_db_dict[enum]['error_msg'].replace('"', '\\"'))) max_enum_val = max(max_enum_val, enum_value) enum_decl.append(' %sMAX_ENUM = %d,' % (validation_error_enum_name, max_enum_val + 1)) enum_decl.append('};') -- cgit v1.2.3