[eluser]Zero-10[/eluser]
I cannot find a solution to this and I really hope someone can help me out with this. Textbox are submitting in Latin to the database even though it seems to be setup correctly.
In the database, the specific column is utf8_general_ci
In my controller I have added
Code:
$this->load->helper('text');
As per suggested by another thread. This did nothing.
The help document says it's automatic and my view has:
Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Looks fine to me.
Everything else gets data passed through without a problem but it's the darn textbox that kills it. I don't know how to force feed the form to convert to UTF-8 but all the other boxes seem to be converting pretty darn well.
Here's the code for the textbox without the CSS elements:
Code:
<textarea id="body_text" name="body_text" maxlength="2500" value="<?= set_value('body_text'); ?>"></textarea>
As for my controller, here is the function that submits the data:
Code:
if ($this->input->post('upload')) {
$this->load->helper('text');
$this->createnews->do_upload();
}
And lastly, the validation for the textbox:
Code:
$this->form_validation->set_rules('body_text', 'Article', 'required|htmlspecialchars|max_length[2500]|xss_clean');
I've tried to get rid of the XSS_CLEAN and got rid of the TEXT helper, but still no dice. Thank you for your time and help me spare this fustration!
EDIT:
What I aim to do in the end is be able to support an alternative language and special characters as well as line breaks and the like. When viewing an article characters like "<" will not be parsed but rather an array of bbcode will be used instead (security reasons). For now I'm just looking for the ability to send that data to the database. Again, it works fine with input=text but not a full <textbox>