Skip to content

Commit

Permalink
Merge pull request #11 from FlashSystems/master
Browse files Browse the repository at this point in the history
UTF-8 characters are not correctly decoded into an UTF-8 buffer.
  • Loading branch information
akalongman committed Oct 19, 2015
2 parents cc66ba5 + 601ddb7 commit 9ccda8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stringutilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def run(self, edit):
if not region.empty():
text = self.view.substr(region).encode(self.enc())
t = base64.b64encode(text)
txt = str(t,'ascii')
txt = str(t, self.enc())
self.view.replace(edit, region, txt)

def enc(self):
Expand All @@ -137,7 +137,7 @@ def run(self, edit):
if not region.empty():
text = self.view.substr(region).encode(self.enc())
t = base64.b64decode(text)
txt = str(t,'ascii')
txt = str(t, self.enc())
self.view.replace(edit, region, txt)

def enc(self):
Expand Down

0 comments on commit 9ccda8f

Please sign in to comment.