Skip to content


Subversion checkout URL

You can clone with
Download ZIP


cms.plugins.text.utils' replace_plugin_tags() treats content as ascii instead of unicode #2109

Eihrister opened this Issue · 4 comments

3 participants



My site runs Django CMS with English, Dutch and Portuguese translations.

Except when I do the following, it goes haywire:
1) Create or change a page
2) Add a text plugin to a content holder
3) Type unicode text with characters above 128, like for instance a simple "Nós".
4) From within the TinyMCE text editor, while it's still open, add a picture plugin.
5) Save the plugin (this goes fine).

1) It shows up as perfect unicode in the database (utf8 / utf8_bin).
2) Retrieving the data goes fine with any UTF-8 compatible tool or script.

However, if you now to try to publish the page from the list of pages, it will just keep on loading and loading and never publish. If you then go directly to into the page setup and click "Publish draft", you'll get a full exception traceback.

This leads back to cms.plugins.text.utils's replace_plugin_tags().

This apparantly treats text coming from the data store (database) as ascii instead of unicode, and will go haywire.

If you remove the picture plugin from the text plugin, all unicode text parses fine and vice-versa.
If you create the picture plugin seperately (outside) the text plugin container, it also works fine.

I tried to use it this way because I wanted to have them in columns without having to create a new template/placeholders.

Thanks for reading :)



After dumping the database to disk, replacing all utf8_bin references in the dump file with utf8_general_ci and re-reading the dump into the database, everything seems fine.

All other applications handle utf8_bin fine, except for this app within Django CMS as well as one or two other CMS apps.


From your description I guess this happens on 2.4 using MySQL database, am I right?
Which Django version are you using?


Can't reproduce the issue on django CMS 2.4.2 using django 1.5, Mysql version 5.5.31 and django-tinymce 1.5.1 using utf8_bin as default collation for the database

@yakky yakky was assigned
@digi604 digi604 added this to the 2.4.X milestone

@Eihrister any update on this?

@yakky yakky removed their assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.