Changeset 5058
- Timestamp:
- 04/21/07 23:21:04 (1 year ago)
- Files:
-
- django/branches/unicode/django/conf/global_settings.py (modified) (1 diff)
- django/branches/unicode/django/core/management.py (modified) (1 diff)
- django/branches/unicode/django/template/loaders/app_directories.py (modified) (1 diff)
- django/branches/unicode/django/template/loaders/eggs.py (modified) (1 diff)
- django/branches/unicode/django/template/loaders/filesystem.py (modified) (1 diff)
- django/branches/unicode/docs/settings.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/unicode/django/conf/global_settings.py
r5054 r5058 96 96 DEFAULT_CHARSET = 'utf-8' 97 97 98 # Encoding of files read from disk (template and initial SQL files). 99 FILE_CHARSET = 'utf-8' 100 98 101 # E-mail address that error messages come from. 99 102 SERVER_EMAIL = 'root@localhost' django/branches/unicode/django/core/management.py
r5054 r5058 380 380 if os.path.exists(sql_file): 381 381 fp = open(sql_file, 'U') 382 for statement in statements.split(fp.read() ):382 for statement in statements.split(fp.read().decode(settings.FILE_CHARSET)): 383 383 # Remove any comments from the file 384 statement = re.sub( r"--.*[\n\Z]", "", statement)384 statement = re.sub(ur"--.*[\n\Z]", "", statement) 385 385 if statement.strip(): 386 output.append(statement + ";")386 output.append(statement + u";") 387 387 fp.close() 388 388 django/branches/unicode/django/template/loaders/app_directories.py
r4265 r5058 35 35 for filepath in get_template_sources(template_name, template_dirs): 36 36 try: 37 return (open(filepath).read() , filepath)37 return (open(filepath).read().decode(settings.FILE_CHARSET), filepath) 38 38 except IOError: 39 39 pass django/branches/unicode/django/template/loaders/eggs.py
r4265 r5058 19 19 for app in settings.INSTALLED_APPS: 20 20 try: 21 return (resource_string(app, pkg_name), 'egg:%s:%s ' % (app, pkg_name)) 21 return (resource_string(app, pkg_name), 'egg:%s:%s ' % (app, pkg_name)).decode(settings.FILE_CHARSET) 22 22 except: 23 23 pass django/branches/unicode/django/template/loaders/filesystem.py
r3575 r5058 15 15 for filepath in get_template_sources(template_name, template_dirs): 16 16 try: 17 return (open(filepath).read() , filepath)17 return (open(filepath).read().decode(settings.FILE_CHARSET), filepath) 18 18 except IOError: 19 19 tried.append(filepath) django/branches/unicode/docs/settings.txt
r5054 r5058 426 426 or ``django.core.mail.mail_managers``. You'll probably want to include the 427 427 trailing space. 428 429 FILE_CHARSET 430 ------------ 431 432 Default: ``'utf-8'`` 433 434 The character encoding used to decode any files read from disk. This includes 435 template files and initial SQL data files. 428 436 429 437 FIXTURE_DIRS
