Eclipse/PyDev - BOM Lexical Error

Diez B. Roggisch deets at web.de
Tue Oct 5 04:11:15 EDT 2010


TheOne <daewon.yoon at gmail.com> writes:

> On Oct 4, 9:26 pm, de... at web.de (Diez B. Roggisch) wrote:
>> TheOne <daewon.y... at gmail.com> writes:
>> > Hi.
>>
>> > I installed eclipse/pydev today.
>> > I created a pydev project and added python source files with utf-8
>> > BOM.
>> > Eclipse/Pydev reports lexical error :
>> >   Lexical error at line 1, column 1. Encountered: "\ufeff" (65279),
>> > after : ""
>>
>> > I want the source files to have BOM character. How could I shut off
>> > this error msg?
>>
>> No idea. Why do you want it? Is somebody else processing these scripts?
>> If it's about declaring them to be utf-8, you should consider placing
>>
>> # -*- coding: utf-8 -*-
>>
>> on the first or second line. That works for python, and should work for eclipse.
>>
>> Diez
>
> I also included that "# -*- coding:" line. I just don't want me or
> other
> project members to accidentally save them in different encoding. So I
> (and
> my team) thought it would be safe to have the BOM character.

Well, me and my team we don't have it, but rarely if ever (can't
remember when) issues with this. And we are using vim, emacs + pydev.

Diez



More information about the Python-list mailing list