diff options
author | Neil <nyamatongwe@gmail.com> | 2013-08-01 09:40:57 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2013-08-01 09:40:57 +1000 |
commit | db70afe9c7dd79152819cc63e67c132805a57702 (patch) | |
tree | 19b124c41639f3c698a610a75f04bdceacb54067 /scripts/GenerateCaseConvert.py | |
parent | 0f25f94903c031e9babb0aae6747c608fba7b97d (diff) | |
download | scintilla-mirror-db70afe9c7dd79152819cc63e67c132805a57702.tar.gz |
Bug [#1506]. In some locales Visual C++ fails with UTF-8 in string literals.
Fixed by using hex escapes for non-ASCII.
Diffstat (limited to 'scripts/GenerateCaseConvert.py')
-rw-r--r-- | scripts/GenerateCaseConvert.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/GenerateCaseConvert.py b/scripts/GenerateCaseConvert.py index 841cdcc51..bcf49236f 100644 --- a/scripts/GenerateCaseConvert.py +++ b/scripts/GenerateCaseConvert.py @@ -101,6 +101,9 @@ def groupRanges(symmetrics): return rangeGroups, nonRanges +def escape(s): + return "".join((chr(c) if chr(c) in string.ascii_letters else "\\x%x" % c) for c in s.encode('utf-8')) + def updateCaseConvert(): symmetrics, complexes = conversionSets() @@ -114,7 +117,7 @@ def updateCaseConvert(): print(len(symmetrics), "symmetric") - complexLines = ['"%s|%s|%s|%s|"' % x for x in complexes] + complexLines = ['"%s|%s|%s|%s|"' % tuple(escape(t) for t in x) for x in complexes] print(len(complexLines), "complex") Regenerate("../src/CaseConvert.cxx", "//", rangeLines, nonRangeLines, complexLines) |