[Python-checkins] bpo-41038: Fix non-ASCII string corruption in Win32 resource files (GH-20985)

Nikita Nemkin webhook-mailer at python.org
Wed Jun 24 12:27:55 EDT 2020


https://github.com/python/cpython/commit/33b79b11b891adea5a916df8e3779505b37aabe7
commit: 33b79b11b891adea5a916df8e3779505b37aabe7
branch: master
author: Nikita Nemkin <nikita at nemkin.ru>
committer: GitHub <noreply at github.com>
date: 2020-06-24T17:27:42+01:00
summary:

bpo-41038: Fix non-ASCII string corruption in Win32 resource files (GH-20985)

In absence of explicit declaration, resource compiler uses system
codepage. When this codepage is DBCS or UTF-8, Python's copyright
string is corrupted, because it contains copyright sign encoded
as \xA9.

The fix is to explicitly declare codepage 1252.

files:
M PC/python_ver_rc.h

diff --git a/PC/python_ver_rc.h b/PC/python_ver_rc.h
index c318d4487ea1b..060aecdc675cb 100644
--- a/PC/python_ver_rc.h
+++ b/PC/python_ver_rc.h
@@ -1,6 +1,7 @@
 // Resource script for Python core DLL.
 // Currently only holds version information.
 //
+#pragma code_page(1252)
 #include "winver.h"
 
 #define PYTHON_COMPANY   "Python Software Foundation"



More information about the Python-checkins mailing list