Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode error #3

Closed
FichteFoll opened this issue Jun 26, 2013 · 2 comments
Closed

Unicode error #3

FichteFoll opened this issue Jun 26, 2013 · 2 comments
Labels

Comments

@FichteFoll
Copy link
Owner

Reported by @vovkkk (source):

date format: %y-%b-%d %H:%M or just %b
env: Windows 7 with Russian l10n, ST 2.0.1 2217
error:

Traceback (most recent call last):
  File ".\sublime_plugin.py", line 356, in run_
  File ".\insert_date.py", line 38, in run
  File ".\encodings\utf_8.py", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 4-6: invalid data

If I replace utf-8 with cp1251 then it works as it should.

I'm not sure what way is best but here I've used this:

sys_enc = locale.getpreferredencoding()
text = text.decode(sys_enc) 

seems to work

@vovkkk
Copy link

vovkkk commented Jun 26, 2013

btw, in Python 3 'str' object has no attribute 'decode' (see aziz/PlainTasks#83)

@FichteFoll
Copy link
Owner Author

Thanks for the heads up but I fear that I have to adjust many parts for ST3 compatibility (I was messing a long time with encodings, e.g. for "local" %Z). Maybe I will just split the package into two branches and only continue developing for ST3 because as it is now this package is pretty much feature complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants