Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reversing ENUM field with UTF-8 values fails #896

Open
kordianbruck opened this issue Mar 11, 2015 · 2 comments
Open

Reversing ENUM field with UTF-8 values fails #896

kordianbruck opened this issue Mar 11, 2015 · 2 comments
Labels

Comments

@kordianbruck
Copy link

Consider a MYSQL Enum field with following allowed values:

'Antarktika','Australien','Afrika','Nordamerika','Südamerika','Europa','Asien'

when running propel reverse on this it will fail with an exception:

PHP Warning:  DOMElement::setAttribute(): string is not in UTF-8 in /var/www/icnmdb/vendor/propel/propel/src/Propel/Generator/Schema/Dumper/XmlDumper.php on line 356
PHP Stack trace:
PHP   1. {main}() /var/www/icnmdb/vendor/propel/propel/bin/propel:0
PHP   2. include() /var/www/icnmdb/vendor/propel/propel/bin/propel:4
PHP   3. Symfony\Component\Console\Application->run() /var/www/icnmdb/vendor/propel/propel/bin/propel.php:29
PHP   4. Symfony\Component\Console\Application->doRun() /var/www/icnmdb/vendor/symfony/console/Symfony/Component/Console/Application.php:126
PHP   5. Symfony\Component\Console\Application->doRunCommand() /var/www/icnmdb/vendor/symfony/console/Symfony/Component/Console/Application.php:195
PHP   6. Symfony\Component\Console\Command\Command->run() /var/www/icnmdb/vendor/symfony/console/Symfony/Component/Console/Application.php:874
PHP   7. Propel\Generator\Command\DatabaseReverseCommand->execute() /var/www/icnmdb/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:253
PHP   8. Propel\Generator\Manager\ReverseManager->reverse() /var/www/icnmdb/vendor/propel/propel/src/Propel/Generator/Command/DatabaseReverseCommand.php:93
PHP   9. Propel\Generator\Schema\Dumper\XmlDumper->dump() /var/www/icnmdb/vendor/propel/propel/src/Propel/Generator/Manager/ReverseManager.php:161
PHP  10. Propel\Generator\Schema\Dumper\XmlDumper->appendDatabaseNode() /var/www/icnmdb/vendor/propel/propel/src/Propel/Generator/Schema/Dumper/XmlDumper.php:64
PHP  11. Propel\Generator\Schema\Dumper\XmlDumper->appendTableNode() /var/www/icnmdb/vendor/propel/propel/src/Propel/Generator/Schema/Dumper/XmlDumper.php:156
PHP  12. Propel\Generator\Schema\Dumper\XmlDumper->appendColumnNode() /var/www/icnmdb/vendor/propel/propel/src/Propel/Generator/Schema/Dumper/XmlDumper.php:278
PHP  13. DOMElement->setAttribute() /var/www/icnmdb/vendor/propel/propel/src/Propel/Generator/Schema/Dumper/XmlDumper.php:356
PHP Warning:  DOMDocument::saveXML(): output conversion failed due to conv error, bytes 0xFC 0x64 0x61 0x6D in /var/www/icnmdb/vendor/propel/propel/src/Propel/Generator/Schema/Dumper/XmlDumper.php on line 66
PHP Stack trace:
PHP   1. {main}() /var/www/icnmdb/vendor/propel/propel/bin/propel:0
PHP   2. include() /var/www/icnmdb/vendor/propel/propel/bin/propel:4
PHP   3. Symfony\Component\Console\Application->run() /var/www/icnmdb/vendor/propel/propel/bin/propel.php:29
PHP   4. Symfony\Component\Console\Application->doRun() /var/www/icnmdb/vendor/symfony/console/Symfony/Component/Console/Application.php:126
PHP   5. Symfony\Component\Console\Application->doRunCommand() /var/www/icnmdb/vendor/symfony/console/Symfony/Component/Console/Application.php:195
PHP   6. Symfony\Component\Console\Command\Command->run() /var/www/icnmdb/vendor/symfony/console/Symfony/Component/Console/Application.php:874
PHP   7. Propel\Generator\Command\DatabaseReverseCommand->execute() /var/www/icnmdb/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:253
PHP   8. Propel\Generator\Manager\ReverseManager->reverse() /var/www/icnmdb/vendor/propel/propel/src/Propel/Generator/Command/DatabaseReverseCommand.php:93
PHP   9. Propel\Generator\Schema\Dumper\XmlDumper->dump() /var/www/icnmdb/vendor/propel/propel/src/Propel/Generator/Manager/ReverseManager.php:161
PHP  10. DOMDocument->saveXML() /var/www/icnmdb/vendor/propel/propel/src/Propel/Generator/Schema/Dumper/XmlDumper.php:66
Schema reverse engineering finished.

The outputed xml is incomplete and stops right at the 'ü' sign.

@marcj marcj added the Bug label May 30, 2015
@lumpiluk
Copy link

In case anyone's having similar problems, for me the solution was to append "charset=UTF8", resulting in the following command:

propel reverse 'mysql:host=localhost;dbname=backup_2015-08-10;user=root;password=;charset=UTF8'

@rinkla3024
Copy link

May I ask what is the underlying datatype the enum is represented as in the base class? My reverse command succeeds, but reading of data always returns null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants