You are correct.  #-*- coding: utf-8 -*- specifies the source encoding for that 
module.  I drew an incorrect conclusion from the results of some debugging.  On 
OSX Python handles utf-8 fine as-is, but the same fails on Windows unless you 
do something to change the default encoding as described earlier.

The problem I've run into on Windows is that one or more Tkinter widgets 
generates an error when passed unicode text that contains code points greater 
than 127.  After changing the encoding to utf-8 it works just fine.

My question, however, was whether pyinstaller will have any problems picking up 
changes to site.py.  So far the reload(sys) hack has been working fine, so I 
may not need to deal with the 'proper' solution in any case.

Lynn
 

On Nov 7, 2012, at 11:43 AM, Hartmut Goebel <[email protected]> wrote:

> Am 05.11.2012 22:08, schrieb Lynn Oliver:
>> 
>> For OSX, you can set the encoding by placing the following as the first or 
>> second line of a module:
>> #-*- coding: utf-8 -*-
>> 
>> That doesn't work on Windows, as Python apparently sets the encoding when 
>> starting up and won't change it later.  
>> 
>> [...]
>> Does this sound correct?
> 
> No, this sound wrong.
> 
> The coding-line effects only the *single* file, which contains this line. It 
> does not set any default-encoding nor does it effect other files. Each file 
> has to define its encoding by itself. See 
> http://docs.python.org/2/reference/lexical_analysis.html#encoding-declarations
> 
> What are the problems you encounter?
> 
> -- 
> Schönen Gruß 
> Hartmut Goebel 
> Dipl.-Informatiker (univ), CISSP, CSSLP
> Goebel Consult 
> http://www.goebel-consult.de
> 
> Monatliche Kolumne: 
> http://www.cissp-gefluester.de/2011-02-fleisige-datensammler-fur-lukratives-geschaeftsmodell-gesucht
>  
> Blog: http://www.goebel-consult.de/blog/20060215
> 
> Goebel Consult ist Mitglied bei http://www.7-it.de/
> 

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to