Trying to set a cookie within a python script

Nik Gr nikos.the.gr33k at gmail.com
Tue Aug 3 05:06:05 EDT 2010


  Στις 3/8/2010 10:39 πμ, ο/η Chris Rebert έγραψε:
>> Please tell me the difference between 3 things.
>>
>> a) Asking Notepad++(my editor) to save all my python scripts as UTF-8
>> without BOM.
> That affects what encoding the text file comprising the source code
> itself is in.

What does this practically mean? Perhaps you mean that it affects the 
way this file will be stored in the hard disk?

For example is it different to say to Notapad++ to save it as 'Asci'i 
and different to save it as 'UTF-8 without BOM'?

What should i use? My script only containes python code(english) and 
greek chars inside print statemetns.

>> b) Using this line '# -*- coding: utf-8 -*-' Isn't this line supposed
>> to tell browser that the contents of this python script as in UTF-8
>> and to handle it as such?
> This tells Python what encoding the text file comprising the source
> code itself is in.
>
What practically does this mean?

What difference does it have with (a) ?

>> c) print ''' Content-Type: text/html; charset=UTF-8 /n'''
> This tells the web browser what encoding the HTML you're sending it is
> in. Said HTML is output by your Python script and must match the
> encoding you specify in (c).
When a python script runs it produces html output or only after the 
python's output to the Web Server the html output is produced?



More information about the Python-list mailing list