durusmail: quixote-users: Re: Htmltext and latin-1 characters
Htmltext and latin-1 characters
2006-05-10
Re: [Cheetahtemplate-discuss] Htmltext and latin-1 characters
2006-05-10
Re: [Cheetahtemplate-discuss] Htmltext and latin-1 characters
2006-05-11
Re: [Cheetahtemplate-discuss] Htmltext and latin-1 characters
2006-05-10
2006-05-11
2006-05-11
2006-05-11
2006-05-11
2006-05-11
2006-05-13
2006-05-13
2006-05-15
Re: Htmltext and latin-1 characters
2006-06-04
2006-06-06
2006-06-07
2006-06-08
Re: Htmltext and latin-1 characters
2006-06-05
2006-06-05
2006-06-05
Re: Htmltext and latin-1 characters
Akihiro KAYAMA
2006-06-06
In article <20060604163940.GB5721@tleilax.local>,
ak <12345alex@gmx.net> writes:

12345alex> you can also place a file 'sitecustomize.py' in your PYTHONPATH
12345alex> environment-variable and make the file contain:
12345alex>
12345alex> import sys
12345alex> sys.setdefaultencoding("utf-8")

I don't know why it is forced to be placed in site global module.

- Site administrators can't assure that any python code executed on
  their site has no side effect if default encoding is changed from
  us-ascii.

- Python programmers can't depend on site specific setting, if they
  want their code to be generic, although Python's implicit encoding
  conversion could make them feel relaxed.

Perhaps default encoding should be a property of each modules, because
programmers know whether default encoding is supposed to be us-ascii
or not in their code. Changing default encoding in each unicode
derived class is also useful, as QPY's u8 class does.

In addition, I worry about unicode memory inefficiency.
Character-by-character processing is rare in web applications, so
it seemed to be a better choice for web applications to use UTF-8 string
mainly for literal and variables, and unicode variables if needed.
But I don't have any profile yet.

-- kayama
reply