Offline migration special characters are not translated properly. #1449
-
Hi, I am facing the issue, that special chars are not properly translated from a head to a offline sql migration skript. Sql version, that needs to be translated:
The migration script:
After running the command "alembic upgrade heads --sql > initial_migration_scripts.sql" the generated offline migration skript looks like this ---initial_migration_scripts.sql
As you can see "Datum Außerkraft" was translated to "Datum Au├ƒerkraft". I hope you have some information on how to fix this issue. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
hi - it would seem you have some encoding issue somewhere, your script as written works fine on this end, sample diff - INSERT [dbo].[attributes] ([name], [display_name], [type], [default_values], [is_required], [validation_regex]) VALUES (N'datum_ausserkraft', N'Datum Außerkraft', N'date', NULL, 1, NULL);
-
-INSERT INTO alembic_version (version_num) VALUES ('069aa19fda58') RETURNING alembic_version.version_num;
-
-COMMIT;
-
+ INSERT [dbo].[attributes] ([name], [display_name], [type], [default_values], [is_required], [validation_regex]) VALUES (N'datum_ausserkraft', N'Datum Außerkraft', N'date', NULL, 1, NULL)
make sure the encoding of your original .sql file is what you expect, that the encoding used when you Shorter answer I'd triple check your file is encoded in utf-8 and that the platform encoding in use is also utf-8. |
Beta Was this translation helpful? Give feedback.
-
I solved the issue with modifing the run_migrations_offline in env.py: Added buffer:
Wrote output manually
|
Beta Was this translation helpful? Give feedback.
I solved the issue with modifing the run_migrations_offline in env.py:
Added buffer:
Wrote output manually