Fix Window family tree title for non-ASCII chars on Windows (#932)
Fixes #11390 As it says, if Family Tree name contained non-ASCII characters, the titlebar on Windows would display it wrong. Turned out to be reading of a utf8 file without the 'encoding' set. On Windows this results in using the default encoding which is one of the code pages, NOT utf8.
This commit is contained in:
parent
16c8e61944
commit
73d19851ef
@ -280,7 +280,7 @@ class CLIManager:
|
|||||||
# Attempt to figure out the database title
|
# Attempt to figure out the database title
|
||||||
path = os.path.join(filename, "name.txt")
|
path = os.path.join(filename, "name.txt")
|
||||||
try:
|
try:
|
||||||
with open(path) as ifile:
|
with open(path, encoding='utf8') as ifile:
|
||||||
title = ifile.readline().strip()
|
title = ifile.readline().strip()
|
||||||
except:
|
except:
|
||||||
title = filename
|
title = filename
|
||||||
|
@ -757,7 +757,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
if self._directory:
|
if self._directory:
|
||||||
filepath = os.path.join(self._directory, "name.txt")
|
filepath = os.path.join(self._directory, "name.txt")
|
||||||
try:
|
try:
|
||||||
with open(filepath, "r") as name_file:
|
with open(filepath, "r", encoding='utf8') as name_file:
|
||||||
name = name_file.readline().strip()
|
name = name_file.readline().strip()
|
||||||
except (OSError, IOError) as msg:
|
except (OSError, IOError) as msg:
|
||||||
LOG.error(str(msg))
|
LOG.error(str(msg))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user