On Mon, 2007-04-09 at 18:56 +0400, Ivan Sagalaev wrote:
> As implemented now in unicode branch templates are loaded from files 
> stored only in utf-8 (as far as I can read the code). However there's a 
> problem with legacy template files that are stored in one-byte 
> encodings. This is unfortunately not a rare thing and happen to raise 
> offenses from developers who we are forcing effectively recode all their 
> template files (and may be change text editors etc.)
> 
> May be a TEMPLATE_CHARSET setting will be useful?

Yeah, I wondered about this. I was kind of hoping it wouldn't be an
issue, but people will insist on using non-portable encodings in their
files even in the 21st century. :-(

I'm not so much worried about the one-off conversion (after all, it's
for those peoples' benefit that we're doing this) as much as filesystems
that store in a particular encoding by default. There's no reliable,
non-expensive way to automatically detect the file encoding, so it
probably has to be done with a setting.

TEMPLATE_CHARSET is not the right name, though. Templates aren't the
problem: the filesystem encoding is. So maybe FILESYSTEM_ENCODING or
something explicit like that. We'll need to graft it into each
filesystem-based template loader and it defaults to utf-8.

Unless anybody can think of a really good technical reason not to have
this setting, I'm inclined to put it in.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to