[Webkit-unassigned] [Bug 37765] REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 20 15:10:14 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=37765





--- Comment #40 from Dirk Pranke <dpranke at chromium.org>  2010-04-20 15:10:13 PST ---
(In reply to comment #39)
> (In reply to comment #38)
> > So, to summarize the thinking in this patch:
> > 
> > 1) assume all text files are encoded on disk as UTF-8
> 
> More precisely: be explicit about how things are encoded, whatever that
> encoding may be.
> 

I was (perhaps badly) attempting to be stronger than that. What I meant was,
previously we had probably assumed that all of the files are ASCII. We don't
want to assume that, but since we don't want to try and do encoding detection,
we should probably assume something, and that should probably be UTF-8.

> > 2) read files using codecs.open(..., "r", encoding="utf-8")
> 
> Possibly.  This patch uses a combination.  codecs.open makes file object return
> unicode() strings instead of str byte arrays from read() and friends.  We use
> that in some palces.  cjerdonek was suggesting we standardize, but I didn't do
> a good job of that in this patch.

I agree with Chris we should standardize, although it doesn't have to happen in
this patch. We should file a separate bug to clean up the rest of the open()
calls.

> 
> > 3) write files using codecs.open(..., "w", enocding="utf-8"),
> > write(s.encode("utf-8")) 
> >     if s is a string that is not known to be encoded already
> 
> One or the other, not both.  if you open with codecs.open it will do the magic
> for you.  if you open with open() you have to encode to a byte array (str)
> before calling write.

Okay. I wasn't clear about that.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list