Home Download Buy Blog Forum Support

Python utf8

Python utf8

Postby libbkmz on Sat Jan 14, 2012 9:10 am

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
Code: Select all
{
    "cmd": ["python2.7", "$file"]
}


I getting this:
Code: Select all
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:
Code: Select all
response = bf.getAllMarkets(ExchangeUK)
for i in response.marketData:
    print i.marketName

It prints names in Russian
libbkmz
 
Posts: 4
Joined: Sat Jan 14, 2012 8:59 am

Re: Python utf8

Postby libbkmz on Fri Jan 27, 2012 2:27 pm

Anyone knows the solution?
libbkmz
 
Posts: 4
Joined: Sat Jan 14, 2012 8:59 am

Re: Python utf8

Postby tito on Fri Jan 27, 2012 11:25 pm

I'm sick all this UTF8 stupid errors.

Can we use a UTF8 safe version of python!?
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 851
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 23 guests