summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/ext/sqlsoup.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/sqlsoup.py b/lib/sqlalchemy/ext/sqlsoup.py
index 31dbcb794..378174fb7 100644
--- a/lib/sqlalchemy/ext/sqlsoup.py
+++ b/lib/sqlalchemy/ext/sqlsoup.py
@@ -444,6 +444,9 @@ def _selectable_name(selectable):
def class_for_table(selectable, **mapper_kwargs):
selectable = expression._selectable(selectable)
mapname = 'Mapped' + _selectable_name(selectable)
+ if isinstance(mapname, unicode):
+ engine_encoding = selectable.metadata.bind.dialect.encoding
+ mapname = mapname.encode(engine_encoding)
if isinstance(selectable, Table):
klass = TableClassType(mapname, (object,), {})
else: