gtk2/gtk/gen-rc.py
Christoph Reiter 5107735c9f build: always use utf-8 when reading/writing text files
open() in text mode should never be used without an encoding because it defaults
to the locale encoding which is rarely what is wanted.

This fixes the Windows build in some cases (depending on the locale/paths used)
2019-06-25 08:53:26 +02:00

22 lines
553 B
Python

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
out_file = sys.argv[1]
in_file = sys.argv[2]
old_msvc = sys.argv[3]
with open(out_file, 'w', encoding='utf-8') as o:
if old_msvc is not None and old_msvc == "1":
o.write("#define ISOLATION_AWARE_ENABLED 1\n")
o.write('#include <winuser.h>\n')
with open(in_file, 'r', encoding='utf-8') as f:
for line in f:
o.write(line)
o.write('\n')
o.write('ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST libgtk3.manifest')