Sublime Forum

Python utf8

#1

Hi all. I have some troubles with debugging python application.
So, I use bfpy(Betfair python api) which is based on XML. I’m sorry, but I have not figured strongly with this API. Main trouble,
when i launching script with sublime, with this build system

{ "cmd": "python2.7", "$file"] }

I getting this:

Traceback (most recent call last): File "/home/bkmz/Dev/python/betfair/test.py", line 28, in <module> print unicode(i.marketName) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128)

But, when i launch from command-line python2 main.py all working fine.

PS code example:

response = bf.getAllMarkets(ExchangeUK) for i in response.marketData: print i.marketName
It prints names in Russian

0 Likes

#2

Anyone knows the solution?

0 Likes

#3

I’m sick all this UTF8 stupid errors.

Can we use a UTF8 safe version of python!?

0 Likes