Python3 IO encoding changes

This commit is contained in:
LoafyLemon 2022-09-21 19:22:14 +01:00
parent af2a4a4a85
commit c352f8cea3
3 changed files with 6 additions and 3 deletions

View File

@ -25,7 +25,7 @@ init python:
logo = "#000" logo = "#000"
# Read manifest # Read manifest
with renpy.file(manifest) as f: with renpy.open_file(manifest) as f:
data = json.load(f) data = json.load(f)
modname = data.get("Name", None) modname = data.get("Name", None)
@ -61,7 +61,7 @@ init python:
fn = os.path.split(file)[1] fn = os.path.split(file)[1]
with renpy.file(file) as s: with renpy.open_file(file) as s:
data = s.read() data = s.read()
print "Loading '{}'".format(mod) print "Loading '{}'".format(mod)

View File

@ -113,6 +113,9 @@ define config.enter_replay_transition = None
define config.exit_replay_transition = None define config.exit_replay_transition = None
define config.say_attribute_transition = d3 define config.say_attribute_transition = d3
# Python
define config.open_file_encoding = "utf-8"
# Garbage Collector # Garbage Collector
# define config.manage_gc = True # define config.manage_gc = True
# define config.gc_thresholds = (25000, 10, 10) # define config.gc_thresholds = (25000, 10, 10)

View File

@ -1,6 +1,6 @@
init python: init python:
whitespace_dict = {} whitespace_dict = {}
with renpy.file("images.whitespace") as fp: with renpy.open_file("images.whitespace") as fp:
line = fp.readline() line = fp.readline()
while line: while line:
path, area = line.strip("\r\n").split(':') path, area = line.strip("\r\n").split(':')