Ticket #4021: 4021.diff
File 4021.diff, 3.8 KB (added by , 18 years ago) |
---|
-
django/conf/global_settings.py
95 95 DEFAULT_CONTENT_TYPE = 'text/html' 96 96 DEFAULT_CHARSET = 'utf-8' 97 97 98 # Charset of template files 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' 100 103 -
django/core/management.py
545 545 print "Installing custom SQL for %s.%s model" % (app_name, model._meta.object_name) 546 546 try: 547 547 for sql in custom_sql: 548 cursor.execute(sql )548 cursor.execute(sql.decode(settings.FILE_CHARSET)) 549 549 except Exception, e: 550 550 sys.stderr.write("Failed to install custom SQL for %s.%s model: %s" % \ 551 551 (app_name, model._meta.object_name, e)) … … 655 655 try: 656 656 cursor = connection.cursor() 657 657 for sql in sql_list: 658 cursor.execute(sql )658 cursor.execute(sql.decode(settings.FILE_CHARSET)) 659 659 except Exception, e: 660 660 sys.stderr.write(style.ERROR("""Error: %s couldn't be reset. Possible reasons: 661 661 * The database isn't running or isn't configured correctly. … … 707 707 try: 708 708 cursor = connection.cursor() 709 709 for sql in sql_list: 710 cursor.execute(sql )710 cursor.execute(sql.decode(settings.FILE_CHARSET)) 711 711 except Exception, e: 712 712 sys.stderr.write(style.ERROR("""Error: Database %s couldn't be flushed. Possible reasons: 713 713 * The database isn't running or isn't configured correctly. -
django/template/loaders/app_directories.py
34 34 def load_template_source(template_name, template_dirs=None): 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 40 40 raise TemplateDoesNotExist, template_name -
django/template/loaders/filesystem.py
14 14 tried = [] 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) 20 20 if tried: -
django/template/loaders/eggs.py
18 18 pkg_name = 'templates/' + template_name 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 24 24 raise TemplateDoesNotExist, template_name