On 2010-08-14, Martin v. Loewis wrote:
>> Is there a standard way to autodetect the encoding of a text file?
> Use the chardet module:
> http://chardet.feedparser.org/
Very timely: the python-chardet package just seems to have appeared
on debian squeeze :-) After my latest "aptitude safe-upgrad
> Is there a standard way to autodetect the encoding of a text file?
Use the chardet module:
http://chardet.feedparser.org/
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
On Saturday 14 August 2010, it occurred to Steven D'Aprano to exclaim:
> On Fri, 13 Aug 2010 18:25:46 -0400, Terry Reedy wrote:
> > A short background to MRAB's answer which I will try to get right.
> >
> > The byte-order-mark was invented for UTF-16 encodings so the reader
> > could determine whe
On Fri, 13 Aug 2010 18:25:46 -0400, Terry Reedy wrote:
> A short background to MRAB's answer which I will try to get right.
>
> The byte-order-mark was invented for UTF-16 encodings so the reader
> could determine whether the pairs of bytes are in little or big endiean
> order, depending on wheth
A short background to MRAB's answer which I will try to get right.
The byte-order-mark was invented for UTF-16 encodings so the reader
could determine whether the pairs of bytes are in little or big endiean
order, depending on whether the first two bute are fe and ff or ff and
fe (or maybe vic
On Fri, 13 Aug 2010 11:45:28 +0200, Jean-Michel Pichavant wrote:
> I'm trying to update the content of a $Microsoft$ VC2005 project files
> using a python application.
> Since those files are XML data, I assumed I could easily do that.
>
> My problem is that VC somehow thinks that the file is co
Jean-Michel Pichavant wrote:
Hello python world,
I'm trying to update the content of a $Microsoft$ VC2005 project files
using a python application.
Since those files are XML data, I assumed I could easily do that.
My problem is that VC somehow thinks that the file is corrupted and
update the
Jean-Michel Pichavant wrote:
> My problem is however simplier : how do I add such character [a BOM]
> at the begining of the file ?
> I tried
>
> f = open('paf', w)
> f.write(u'\ufeff')
>
> UnicodeEncodeError: 'ascii' codec can't encode character u'\ufeff' in
> position 0: ordinal not in range(12
On 13/08/2010 10:45, Jean-Michel Pichavant wrote:
My problem is however simplier : how do I add such character at the
begining of the file ?
I tried
f = open('paf', w)
f = open ("pag", "wb")
f.write ("\xfe\xff")
TJG
--
http://mail.python.org/mailman/listinfo/python-list
Hello python world,
I'm trying to update the content of a $Microsoft$ VC2005 project files
using a python application.
Since those files are XML data, I assumed I could easily do that.
My problem is that VC somehow thinks that the file is corrupted and
update the file like the following:
-
10 matches
Mail list logo