Skip to content
Browse files

Encode the text as unicode before searching for spaces, in order to m…

…ake sure that the character offsets are correct when dealing with multibyte characters.
  • Loading branch information...
1 parent 5218467 commit 84b965fd02379a93a68d35cbc20a784ec6fe7e31 @jonleighton committed Jul 10, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 trailsave.py
View
1 trailsave.py
@@ -58,6 +58,7 @@ def strip_trailing_spaces(self):
"""
text = self.doc.get_text(self.doc.get_start_iter(), self.doc.get_end_iter(), False)
+ text = unicode(text, 'utf-8')
start_iter = self.doc.get_start_iter()
end_iter = self.doc.get_start_iter()

0 comments on commit 84b965f

Please sign in to comment.
Something went wrong with that request. Please try again.