Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion extractunitypackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

# Update (by Entwicklerpages): Simple fixes for python3 support. Now works on both versions.

import io
import os
import stat
import shutil
Expand Down Expand Up @@ -66,7 +67,7 @@
for j in os.listdir(rootFile):
# grab the real path
if j == 'pathname':
lines = [line.strip() for line in open(os.path.join(rootFile, j))]
lines = [line.strip() for line in open(os.path.join(rootFile, j),'r',encoding="utf-8_sig")]
realPath = lines[0] # should always be on the first line
elif j == 'asset':
hasAsset = True
Expand All @@ -83,6 +84,8 @@

os.makedirs(outputDir)

sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding=sys.stdout.encoding, errors="replace")

for asset in mapping:
path, filename = os.path.split(mapping[asset])

Expand Down