diff options
author | Victor Chang <vichang@google.com> | 2019-12-12 13:58:52 +0000 |
---|---|---|
committer | Victor Chang <vichang@google.com> | 2019-12-16 15:31:09 +0000 |
commit | e84c6b50c239794d1b70ff242855911ff823e505 (patch) | |
tree | 26536a5c4045d887ce35f97b1e0c85e941f68908 /tools/localedata | |
parent | 9dcbd6de8732df6e99c4f9c7bf41ccb777fedf54 (diff) |
Regenerate LocaleDataTables.cpp
LocaleDataTables.cpp is outdated due to ICU update over the years
Test: ./tools/localedata/extract_icu_data.py $ANDROID_BUILD_TOP
Test: m droid
Change-Id: I21918cc0f50c7347e514dc7b015607e19cffb377
Diffstat (limited to 'tools/localedata')
-rwxr-xr-x | tools/localedata/extract_icu_data.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/localedata/extract_icu_data.py b/tools/localedata/extract_icu_data.py index 6b4c34677d96..ca1847af7d06 100755 --- a/tools/localedata/extract_icu_data.py +++ b/tools/localedata/extract_icu_data.py @@ -176,6 +176,9 @@ def read_and_dump_likely_data(icu_data_dir): dump_representative_locales(representative_locales) return likely_script_dict +def escape_script_variable_name(script): + """Escape characters, e.g. '~', in a C++ variable name""" + return script.replace("~", "_") def read_parent_data(icu_data_dir): """Read locale parent data from ICU data files.""" @@ -221,7 +224,7 @@ def dump_parent_data(script_organized_dict): for script in sorted_scripts: parent_dict = script_organized_dict[script] print ('const std::unordered_map<uint32_t, uint32_t> %s_PARENTS({' - % script.upper()) + % escape_script_variable_name(script.upper())) for locale in sorted(parent_dict.keys()): parent = parent_dict[locale] print ' {0x%08Xu, 0x%08Xu}, // %s -> %s' % ( @@ -239,7 +242,7 @@ def dump_parent_data(script_organized_dict): for script in sorted_scripts: print " {{'%c', '%c', '%c', '%c'}, &%s_PARENTS}," % ( script[0], script[1], script[2], script[3], - script.upper()) + escape_script_variable_name(script.upper())) print '};' |