summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorBartosz Grabski <bartosz.grabski@gmail.com>2018-05-27 14:09:54 +0200
committerTim Graham <timograham@gmail.com>2018-06-12 08:29:22 -0400
commitc7d59825d738650e87173d4f9c8781b2e8b8c0c5 (patch)
treeafbfaf69c3616e3ce793ef4655521a6bd3b5c5d9 /django
parent91a02dce97ec677933527deddcce230e6e7ba7c9 (diff)
[2.1.x] Fixed #29452 -- Fixed makemessages setting charset of .pot files.
Backport of 2bc014750adb093131f77e4c20bc17ba64b75cac from master
Diffstat (limited to 'django')
-rw-r--r--django/core/management/commands/makemessages.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index a1e72c73ad..d0776488c3 100644
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -182,8 +182,9 @@ def write_pot_file(potfile, msgs):
found, header_read = False, False
for line in pot_lines:
if not found and not header_read:
- found = True
- line = line.replace('charset=CHARSET', 'charset=UTF-8')
+ if 'charset=CHARSET' in line:
+ found = True
+ line = line.replace('charset=CHARSET', 'charset=UTF-8')
if not line and not found:
header_read = True
lines.append(line)