Trying to set a cookie within a python script

Dotan Cohen dotancohen at gmail.com
Wed Aug 4 04:01:25 EDT 2010


2010/8/4 Νίκος <nikos.the.gr33k at gmail.com>:
> Encodings still give me headaches. I try to understand them as
> different ways to store data in a media.
>
> Tell me something. What encoding should i pick for my scripts knowing
> that only contain english + greek chars??
> iso-8859-7 or utf-8 and why?
>

Always use UTF-8, every modern system supports it, and it will let you
use any arbitrary character that you need, such as maybe a smiley or a
Euro sign. You will avoid headaches with databases and files and all
sorts of other things that you don't yet expect. Declare it in the
HTTP header, and in the HTML meta tag.

Trust me, I maintain gibberish.co.il which specializes in encoding
problems. Just use UTF-8 everywhere and you will save a lot of
headaches.


> Can i save the sting lets say "Νίκος" in different encodings and still
> print out correctly in browser?
>

No.


> ascii = the standard english character set only, right?
>

Pretty much, plus the numbers, some symbols, and a few nonprinting
characters. Read here:
http://en.wikipedia.org/wiki/Ascii


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com



More information about the Python-list mailing list