From: NoName on 24 Dec 2008 04:46 i have 1.py in cp866 encoding: # -*- coding: cp866 -*- print ("ff") It's not work in Python 3.0 Error: File "<decoding error>", line 1 SyntaxError: encoding problem: with BOM what's wrong?
From: Diez B. Roggisch on 24 Dec 2008 08:37 NoName schrieb: > i have 1.py in cp866 encoding: > > # -*- coding: cp866 -*- > print ("ff") > > > > It's not work in Python 3.0 > Error: > > File "<decoding error>", line 1 > SyntaxError: encoding problem: with BOM > > what's wrong? I can only guess, but just because you write the coding-header that doesn't mean that the editor you use does actually *use* that encoding. What I presume it does is to use utf-8, and write that stupid BOM microsoft uses for denoting utf-8-content as first byte. Try using a different editor, or alter it's settings to really use your desired encoding. Diez
From: NoName on 24 Dec 2008 10:09 On 25 ÄÅË, 00:37, "Diez B. Roggisch" <de...(a)nospam.web.de> wrote: > NoName schrieb: > > > i have 1.py in cp866 encoding: > > > # -*- coding: cp866 -*- > > print ("ff") > > > It's not work in Python 3.0 > > Error: > > > File "<decoding error>", line 1 > > SyntaxError: encoding problem: with BOM > > > what's wrong? > > I can only guess, but just because you write the coding-header that > doesn't mean that the editor you use does actually *use* that encoding. > What I presume it does is to use utf-8, and write that stupid BOM > microsoft uses for denoting utf-8-content as first byte. Try using a > different editor, or alter it's settings to really use your desired > encoding. > > Diez I used Far Manager editor. and it *really* used cp866 I can print hex dump of source file. I don't want to use UTF-8 for py-file!
From: Diez B. Roggisch on 24 Dec 2008 11:35 NoName schrieb: > On 25 ���, 00:37, "Diez B. Roggisch" <de...(a)nospam.web.de> wrote: >> NoName schrieb: >> >>> i have 1.py in cp866 encoding: >>> # -*- coding: cp866 -*- >>> print ("ff") >>> It's not work in Python 3.0 >>> Error: >>> File "<decoding error>", line 1 >>> SyntaxError: encoding problem: with BOM >>> what's wrong? >> I can only guess, but just because you write the coding-header that >> doesn't mean that the editor you use does actually *use* that encoding. >> What I presume it does is to use utf-8, and write that stupid BOM >> microsoft uses for denoting utf-8-content as first byte. Try using a >> different editor, or alter it's settings to really use your desired >> encoding. >> >> Diez > > I used Far Manager editor. and it *really* used cp866 > I can print hex dump of source file. > I don't want to use UTF-8 for py-file! How about you show us the python file in question? diez
From: NoName on 25 Dec 2008 08:55 > NoName, Asking people to download a zip file from a website written in > a language and character set that they probably are not familiar with > is liable to make them rather nervous and not bother. It's not a good > way to ask for help. sorry:) Now i know where problem. But i dont know how to solve it. Error ---- C:\Documents and Settings\Ra\òÁÂÏÞÉÊ ÓÔÏÌ>11.py File "<decoding error>", line 1 SyntaxError: encoding problem: with BOM No error ---- C:\Documents and Settings\Ra\òÁÂÏÞÉÊ ÓÔÏÌ>python 11.py test Error when russian symbols in full path to py-script. Is it Python bug? or i need to modify some registry keys? OS: WinXP SP3 Russian. Python 3.0 (r30:67507, Dec 3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)] on win32
|
Next
|
Last
Pages: 1 2 Prev: IMAP: How to implement GMail-like threaded conversations view Next: os.system('cls') |