From 5d09d8769d7eb7fd8dffdf5c0705e25173c59006 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 19 Jun 2008 14:38:56 +0000 Subject: [PATCH] Fixed #6650 -- Added UTF-8 encoding to SQL output provided by management commands. Thanks to farcaller for the suggestion. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7706 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management/commands/sql.py | 2 +- django/core/management/commands/sqlall.py | 2 +- django/core/management/commands/sqlclear.py | 2 +- django/core/management/commands/sqlcustom.py | 2 +- django/core/management/commands/sqlflush.py | 2 +- django/core/management/commands/sqlindexes.py | 2 +- django/core/management/commands/sqlreset.py | 2 +- django/core/management/commands/sqlsequencereset.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/django/core/management/commands/sql.py b/django/core/management/commands/sql.py index 4a0107ac02..bc68a1e43a 100644 --- a/django/core/management/commands/sql.py +++ b/django/core/management/commands/sql.py @@ -7,4 +7,4 @@ class Command(AppCommand): def handle_app(self, app, **options): from django.core.management.sql import sql_create - return '\n'.join(sql_create(app, self.style)) + return u'\n'.join(sql_create(app, self.style)).encode('utf-8') diff --git a/django/core/management/commands/sqlall.py b/django/core/management/commands/sqlall.py index bf3c734bb6..5d510f179a 100644 --- a/django/core/management/commands/sqlall.py +++ b/django/core/management/commands/sqlall.py @@ -7,4 +7,4 @@ class Command(AppCommand): def handle_app(self, app, **options): from django.core.management.sql import sql_all - return '\n'.join(sql_all(app, self.style)) + return u'\n'.join(sql_all(app, self.style)).encode('utf-8') diff --git a/django/core/management/commands/sqlclear.py b/django/core/management/commands/sqlclear.py index d76d6f4de2..8550e88e28 100644 --- a/django/core/management/commands/sqlclear.py +++ b/django/core/management/commands/sqlclear.py @@ -7,4 +7,4 @@ class Command(AppCommand): def handle_app(self, app, **options): from django.core.management.sql import sql_delete - return '\n'.join(sql_delete(app, self.style)) + return u'\n'.join(sql_delete(app, self.style)).encode('utf-8') diff --git a/django/core/management/commands/sqlcustom.py b/django/core/management/commands/sqlcustom.py index 2148a9f307..90b90b6d49 100644 --- a/django/core/management/commands/sqlcustom.py +++ b/django/core/management/commands/sqlcustom.py @@ -7,4 +7,4 @@ class Command(AppCommand): def handle_app(self, app, **options): from django.core.management.sql import sql_custom - return '\n'.join(sql_custom(app)) + return u'\n'.join(sql_custom(app)).encode('utf-8') diff --git a/django/core/management/commands/sqlflush.py b/django/core/management/commands/sqlflush.py index 261aa0d423..d0f71d3875 100644 --- a/django/core/management/commands/sqlflush.py +++ b/django/core/management/commands/sqlflush.py @@ -7,4 +7,4 @@ class Command(NoArgsCommand): def handle_noargs(self, **options): from django.core.management.sql import sql_flush - return '\n'.join(sql_flush(self.style, only_django=True)) + return u'\n'.join(sql_flush(self.style, only_django=True)).encode('utf-8') diff --git a/django/core/management/commands/sqlindexes.py b/django/core/management/commands/sqlindexes.py index b5e86f26d6..9693588a89 100644 --- a/django/core/management/commands/sqlindexes.py +++ b/django/core/management/commands/sqlindexes.py @@ -7,4 +7,4 @@ class Command(AppCommand): def handle_app(self, app, **options): from django.core.management.sql import sql_indexes - return '\n'.join(sql_indexes(app, self.style)) + return u'\n'.join(sql_indexes(app, self.style)).encode('utf-8') diff --git a/django/core/management/commands/sqlreset.py b/django/core/management/commands/sqlreset.py index a2abb855cf..ec40848c42 100644 --- a/django/core/management/commands/sqlreset.py +++ b/django/core/management/commands/sqlreset.py @@ -7,4 +7,4 @@ class Command(AppCommand): def handle_app(self, app, **options): from django.core.management.sql import sql_reset - return '\n'.join(sql_reset(app, self.style)) + return u'\n'.join(sql_reset(app, self.style)).encode('utf-8') diff --git a/django/core/management/commands/sqlsequencereset.py b/django/core/management/commands/sqlsequencereset.py index 6b12d83843..e8dad0bef6 100644 --- a/django/core/management/commands/sqlsequencereset.py +++ b/django/core/management/commands/sqlsequencereset.py @@ -6,4 +6,4 @@ class Command(AppCommand): def handle_app(self, app, **options): from django.db import connection, models - return '\n'.join(connection.ops.sequence_reset_sql(self.style, models.get_models(app))) + return u'\n'.join(connection.ops.sequence_reset_sql(self.style, models.get_models(app))).encode('utf-8')