Changeset 2946:69ee48c77e81 in livinglogic.python.xist

Show
Ignore:
Timestamp:
09/19/07 17:52:21 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
newparser
Message:

Document what Publisher.getencoding() does.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/publishers.py

    r2945 r2946  
    158158        """ 
    159159        if self.encoding is not None: 
     160            # The encoding has been prescribed, so this *will* be used. 
    160161            return self.encoding 
    161162        elif self.encoder is not None: 
     163            # The encoding is determined by the XML declaration in the output, 
     164            # so use that if it has been determined already. If the encoder hasn't 
     165            # determined the encoding yet (e.g. because nothing has been output 
     166            # yet) use utf-8 (which will be what the encoder eventually will decide 
     167            # to use too). Note that this will not work if nothing has been output 
     168            # yet, but later an XML declaration (using a different encoding) will 
     169            # be output, but this shouldn't happen anyway. 
    162170            return self.encoder.encoding or "utf-8" 
    163171        return "utf-8"