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 | b0c0e57a6bf5fa754e7a18bf54bf79e2580fdf18 (patch) | |
tree | 57074441d2a56b4f2b4ab7ee78071a66ebeae073 /scripts/GenerateCaseConvert.py | |
parent | 7b996c0c3f29c7ab47eef1ae9d398337fddcdeaa (diff) | |
download | scintilla-mirror-b0c0e57a6bf5fa754e7a18bf54bf79e2580fdf18.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) |