1

I can't figure out where expression engine is changing my title to html entities.

This is specifically for the required title field

Text like: "Test á Character" is being stored as "Test á Character" in the database.

The collation on the column is utf8_general_ci The collation on the table is utf8_general_ci The default_character_set_name for the db is latin1

I have a custom extension that's hooked into "entry_submission_end" and it stores all the request vars in a temporary table.

If I submit an entry with text "Test á Character", in my extension, the text is being inserted correctly into my temporary table as "Test á Character" but incorrectly by expressionengine into the main channel table as "Test á Character" in the title field.

I'm fairly experienced with diving into the EE code to modify things but I've been unable to locate the source of this issue. I can directly update the db via SQL myself and the characters are inserted properly as well.

This happens both with custom forms and the default expression engine entry editing form.

  • This appears to be pretty similar; any useful info here? expressionengine.stackexchange.com/questions/1557/… – Nick Benson Mar 20 '14 at 16:11
  • I don't know that that's the same issue. This is for new data not necessarily affecting old data. In addition, my other custom fields, like field_id_1 which maps to a textarea handle this character encoding just fine (it isnt converted to html entities in the db). – user452886 Mar 20 '14 at 16:20
3

I figured it out.

in API_channel_entries.php, the title was being brought in before insertion like this:

'title' => ($this->EE->config->item('auto_convert_high_ascii') == 'y') ? ascii_to_entities($data['title']) : $data['title'],

I don't update regularly (we've made a lot of hacks to make EE work for us) so it's likely just my issue but that setting, auto_convert_high_ascii was apparently removed from the config file in some version but at least for the version I have, is still defined as a default in the EE_Config core file. This means it was being defaulted to true.

To solve the issue I added

$config['auto_convert_high_ascii'] = "n";

To config.php

  • Smart solution, thanks for answering the question. – Mutual Mar 20 '14 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.