@@ -68,7 +68,7 @@ def __init__(self):
68
68
changelog_path = os .path .join (info .PATH , 'settings' , '%s.log' % project )
69
69
if os .path .exists (changelog_path ):
70
70
# Attempt to open changelog with utf-8, and then utf-16-le (for unix / windows support)
71
- for encoding_name in ('utf-8 ' , 'utf_16_le ' ):
71
+ for encoding_name in ('utf_8 ' , 'utf_16 ' ):
72
72
try :
73
73
with codecs .open (changelog_path , 'r' , encoding = encoding_name ) as changelog_file :
74
74
if changelog_file .read ():
@@ -183,7 +183,7 @@ def __init__(self):
183
183
184
184
# Get list of developers
185
185
developer_list = []
186
- with codecs .open (os .path .join (info .RESOURCES_PATH , 'contributors.json' ), 'r' , 'utf-8 ' ) as contributors_file :
186
+ with codecs .open (os .path .join (info .RESOURCES_PATH , 'contributors.json' ), 'r' , 'utf_8 ' ) as contributors_file :
187
187
developer_string = contributors_file .read ()
188
188
developer_list = json .loads (developer_string )
189
189
@@ -214,7 +214,7 @@ def __init__(self):
214
214
215
215
# Get list of supporters
216
216
supporter_list = []
217
- with codecs .open (os .path .join (info .RESOURCES_PATH , 'supporters.json' ), 'r' , 'utf-8 ' ) as supporter_file :
217
+ with codecs .open (os .path .join (info .RESOURCES_PATH , 'supporters.json' ), 'r' , 'utf_8 ' ) as supporter_file :
218
218
supporter_string = supporter_file .read ()
219
219
supporter_list = json .loads (supporter_string )
220
220
@@ -259,7 +259,7 @@ def __init__(self):
259
259
changelog_path = os .path .join (info .PATH , 'settings' , 'openshot-qt.log' )
260
260
if os .path .exists (changelog_path ):
261
261
# Attempt to open changelog with utf-8, and then utf-16-le (for unix / windows support)
262
- for encoding_name in ('utf-8 ' , 'utf_16_le ' ):
262
+ for encoding_name in ('utf_8 ' , 'utf_16 ' ):
263
263
try :
264
264
with codecs .open (changelog_path , 'r' , encoding = encoding_name ) as changelog_file :
265
265
for line in changelog_file :
@@ -279,7 +279,7 @@ def __init__(self):
279
279
changelog_path = os .path .join (info .PATH , 'settings' , 'libopenshot.log' )
280
280
if os .path .exists (changelog_path ):
281
281
# Attempt to open changelog with utf-8, and then utf-16-le (for unix / windows support)
282
- for encoding_name in ('utf-8 ' , 'utf_16_le ' ):
282
+ for encoding_name in ('utf_8 ' , 'utf_16 ' ):
283
283
try :
284
284
with codecs .open (changelog_path , 'r' , encoding = encoding_name ) as changelog_file :
285
285
for line in changelog_file :
@@ -298,8 +298,10 @@ def __init__(self):
298
298
changelog_list = []
299
299
changelog_path = os .path .join (info .PATH , 'settings' , 'libopenshot-audio.log' )
300
300
if os .path .exists (changelog_path ):
301
- # Attempt to open changelog with utf-8, and then utf-16-le (for unix / windows support)
302
- for encoding_name in ('utf-8' , 'utf_16_le' ):
301
+ # Attempt to support Linux- and Windows-encoded files by opening
302
+ # changelog with utf-8, then utf-16 (endianness via the BOM, which
303
+ # gets filtered out automatically by the decoder)
304
+ for encoding_name in ('utf_8' , 'utf_16' ):
303
305
try :
304
306
with codecs .open (changelog_path , 'r' , encoding = encoding_name ) as changelog_file :
305
307
for line in changelog_file :
0 commit comments