Bug #105772 import mssql to mysql codec can't encode character '\ufffd' in position

Submitted: 2 Dec 2021 12:21 Modified: 28 Jan 2022 12:49
Reporter: renato gallo Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S1 (Critical)
Version:8.0 OS:Windows
Assigned to: Assigned Account CPU Architecture:Any
Tags: codec can't encode character '\ufffd' in position 4426: character maps to <undef

[2 Dec 2021 12:21] renato gallo
Description:
trying to import mssql db to mysql
in create schemas

Starting...
Create Script File...

Traceback (most recent call last):
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\workbench\wizard_progress_page_widget.py", line 71, in run
    self.func()
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration_schema_creation.py", line 188, in _create_script_task
    self.main.plan.createTargetScript(self.main.plan.state.objectCreationParams["CreateSQLFile"])
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration.py", line 527, in createTargetScript
    grt.modules.DbMySQLFE.createScriptForCatalogObjects(path, self.migrationTarget.catalog, self.state.objectCreationParams)
SystemError: UnicodeEncodeError("'charmap' codec can't encode character '\ufffd' in position 4426: character maps to <undefined>"): error calling Python module function DbMySQLFE.createScriptForCatalogObjects
ERROR: Error during Create Script File: UnicodeEncodeError("'charmap' codec can't encode character '\ufffd' in position 4426: character maps to <undefined>"): error calling Python module function DbMySQLFE.createScriptForCatalogObjects
ERROR: Exception in task 'Create Script File': SystemError('UnicodeEncodeError("\'charmap\' codec can\'t encode character \'\\ufffd\' in position 4426: character maps to <undefined>"): error calling Python module function DbMySQLFE.createScriptForCatalogObjects')

Failed

Starting...
Create Script File...

Traceback (most recent call last):
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\workbench\wizard_progress_page_widget.py", line 71, in run
    self.func()
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration_schema_creation.py", line 188, in _create_script_task
    self.main.plan.createTargetScript(self.main.plan.state.objectCreationParams["CreateSQLFile"])
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration.py", line 527, in createTargetScript
    grt.modules.DbMySQLFE.createScriptForCatalogObjects(path, self.migrationTarget.catalog, self.state.objectCreationParams)
SystemError: UnicodeEncodeError("'charmap' codec can't encode character '\ufffd' in position 4426: character maps to <undefined>"): error calling Python module function DbMySQLFE.createScriptForCatalogObjects
ERROR: Error during Create Script File: UnicodeEncodeError("'charmap' codec can't encode character '\ufffd' in position 4426: character maps to <undefined>"): error calling Python module function DbMySQLFE.createScriptForCatalogObjects
ERROR: Exception in task 'Create Script File': SystemError('UnicodeEncodeError("\'charmap\' codec can\'t encode character \'\\ufffd\' in position 4426: character maps to <undefined>"): error calling Python module function DbMySQLFE.createScriptForCatalogObjects')

Failed

Starting...
Create Script File...

Traceback (most recent call last):
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\workbench\wizard_progress_page_widget.py", line 71, in run
    self.func()
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration_schema_creation.py", line 188, in _create_script_task
    self.main.plan.createTargetScript(self.main.plan.state.objectCreationParams["CreateSQLFile"])
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\migration.py", line 527, in createTargetScript
    grt.modules.DbMySQLFE.createScriptForCatalogObjects(path, self.migrationTarget.catalog, self.state.objectCreationParams)
SystemError: UnicodeEncodeError("'charmap' codec can't encode character '\ufffd' in position 4426: character maps to <undefined>"): error calling Python module function DbMySQLFE.createScriptForCatalogObjects
ERROR: Error during Create Script File: UnicodeEncodeError("'charmap' codec can't encode character '\ufffd' in position 4426: character maps to <undefined>"): error calling Python module function DbMySQLFE.createScriptForCatalogObjects
ERROR: Exception in task 'Create Script File': SystemError('UnicodeEncodeError("\'charmap\' codec can\'t encode character \'\\ufffd\' in position 4426: character maps to <undefined>"): error calling Python module function DbMySQLFE.createScriptForCatalogObjects')

Failed

How to repeat:
click on migration

connect to the source mssql db
connect to the target mysql db
follow the steps
the error appears in create schemas

Suggested fix:
please find the way to encode the character '\ufffd'
[28 Dec 2021 12:49] MySQL Verification Team
Hello renato gallo,

Thank you for the bug report.
Could you please provide sample database to reproduce this issue at our end?

Regards,
Ashwini Patil
[29 Jan 2022 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[19 Feb 2023 12:22] Preston Silva
Hey! Professional writing services https://essaysrescue.com/essaykeeper-review/ are an excellent choice for those who need help writing essays. They can provide expert guidance, advice, and assistance to make sure your essay is well-crafted, professional, and effective.
[9 Jul 2024 17:44] M B
This worked for me: You can try to changing modules\db_mysql_fe_grt.py under def createScriptForCatalogObjects, line 247 from...
file = open(path, "w+")
...to...
file = open(path, "w+", encoding="utf-8")
This will require a restart of MySQL Workbench to take effect.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.054 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.