[Pythonwin] Pywin encoding (again)

Arturo Pérez Mulas arturo_perez at wanadoo.es
Thu Dec 7 15:49:32 CET 2000


Hello.

Sorry if I seem not to be able to understand this. I think I need some more help here. Let me first express my question, and then
some hints I have gotten from the group, to make sure I understand anything at all:

Question:

    - Is it possible to write Python scripts under Pythonwin using non-ascii characters (latin-1 or cp1252 in my case) in comments, docstrings, etc?

What I know/have read/guess, I would appreciate comments on these particular issues also:

- It is not the same to have non-ascii characters in the comments, etc (this depends on the file encoding) than output a certain encoding (which I can get using the appropriate encode).
    
- My WinNT box has a default encoding cp1252, and files edited with, for instance, "Notepad" are thus encoded.
   
- Pythonwin edits and reads files in "utf-8" encoding, so if I open in pythonwin a file edited in "notepad" I will get the file messed up, and the other way round.
    
- So, I guess, what I am trying to find is a way to have pythonwin reading/writing files using my choice of encoding

  To do this I browsed this group, and found a few threads on this, but I only got this all messed up; this is what I could make out:

            - I can change python's default encoding (which is ascii) in "site.py", but I really do not know what is the effect of this

            - Regarding pythonwin, Mark suggested installing the patch that can be downloaded for his site, and then a further patch, but:

                    1. The downloaded patch does not work for me. I get a "cannot import pywin.is_platform_unicode"
                    2. I followed another hint indicating that I should change "pywin.is_platform_unicode" to "pywin.scintilla.view.is_platform_unicode", but I get the same result
                    3. I got pythonwin to work using "pywin.scintilla.is_platform_unicode", but this did not solve my problem.

            - The two lines patch in "interact.py" did not work either.


Thank you all. I promise I will get all the answers on this topic sorted and posted in a website for future reference to everyone!

Arturo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20001207/99d0366e/attachment.html>


More information about the Python-list mailing list