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
19 changes: 10 additions & 9 deletions boundkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import json
import re
import collections

import sys

class BoundKeysCommand(sublime_plugin.TextCommand):
def removeComments(self, text):
Expand Down Expand Up @@ -233,7 +233,7 @@ def run(self, edit):
continue
zip = zipfile.ZipFile(fullPath, "r")
jsonObj = self.jsonify(
str(zip.open(fileZipPath, "r").read(), "utf-8")
str(zip.open(fileZipPath, "r").read(), sys.getfilesystemencoding())
)
zip.close()
except IOError:
Expand Down Expand Up @@ -301,12 +301,13 @@ def run(self, edit):
jsonObj = self.jsonify(
str(zip.open(zipName, "r").read(), "utf-8")
)
userKeys[lastPath] = {}
userKeys[lastPath]["name"] = name
userKeys[lastPath]["loc_key"] = pathName
userKeys[lastPath]["object"] = jsonObj
userKeys[lastPath]["path"] = fullPath
userKeys[lastPath]["zipName"] = zipName
if jsonObj:
userKeys[lastPath] = {}
userKeys[lastPath]["name"] = name
userKeys[lastPath]["loc_key"] = pathName
userKeys[lastPath]["object"] = jsonObj
userKeys[lastPath]["path"] = fullPath
userKeys[lastPath]["zipName"] = zipName
zip.close()
except IOError:
print("File not found: %s" % fullPath)
Expand All @@ -333,7 +334,7 @@ def run(self, edit):
if lastPath in subKeys or lastPath in userKeys:
continue
try:
jsonObj = self.jsonify(open(filePath, "r").read())
jsonObj = self.jsonify(open(filePath, "r", encoding='utf-8').read())
except IOError:
errorLoading.append(filePath)
if jsonObj:
Expand Down