diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 04:17:36 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 04:17:36 +0000 |
commit | 97a28ef93ae420282c3d877d18b2d363abe26ed4 (patch) | |
tree | fb89ee553a4d963401db1b3577ddb9d523462958 /chrome/installer/util/prebuild/create_string_rc.py | |
parent | 2ae64d648884a2c469ab987fb8ddbaa981ca3fe9 (diff) | |
download | chromium_src-97a28ef93ae420282c3d877d18b2d363abe26ed4.zip chromium_src-97a28ef93ae420282c3d877d18b2d363abe26ed4.tar.gz chromium_src-97a28ef93ae420282c3d877d18b2d363abe26ed4.tar.bz2 |
Escape special characters in installer strings (rc file).
Review URL: http://codereview.chromium.org/1980006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46549 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/prebuild/create_string_rc.py')
-rwxr-xr-x | chrome/installer/util/prebuild/create_string_rc.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/installer/util/prebuild/create_string_rc.py b/chrome/installer/util/prebuild/create_string_rc.py index 4c575f5..ba43095 100755 --- a/chrome/installer/util/prebuild/create_string_rc.py +++ b/chrome/installer/util/prebuild/create_string_rc.py @@ -157,8 +157,12 @@ def WriteRCFile(translated_strings, out_filename): ) lines = [kHeaderText] for translation_struct in translated_strings: + # Escape special characters for the rc file. + translation = (translation_struct.translation.replace('"', '""') + .replace('\t', '\\t') + .replace('\n', '\\n')) lines.append(u' %s "%s"\n' % (translation_struct.resource_id_str, - translation_struct.translation)) + translation)) lines.append(kFooterText) outfile = open(out_filename + '.rc', 'wb') outfile.write(''.join(lines).encode('utf-16')) |