aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-10-09 09:10:21 -0600
committerMark Lobodzinski <mark@lunarg.com>2017-10-09 14:23:00 -0600
commit540ccf656a2b8f603a90727be06b0f990cbe46e2 (patch)
treee035fb3ec792546bbd79411b7d2dee0daad1e6ce /scripts
parent76bc0c65fe614fa00789b37fb6ad548ca582c6b3 (diff)
downloadusermoji-540ccf656a2b8f603a90727be06b0f990cbe46e2.tar.xz
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
Diffstat (limited to 'scripts')
-rw-r--r--scripts/spec.py4
1 files changed, 3 insertions, 1 deletions
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('};')