Welcome Guest, Not a member yet? Register   Sign In
Euro sign shows as € when form is submitted
#7

[eluser]cheungj[/eluser]
I have a workaround for this at the moment.
Basically, I'm storing the € sign in the database as its HTML equivalent -- & euro; (without the space).
I'm displaying it onto the page (from within the view) using:
Code:
$this->form_validation->set_value('description', $description)
I'm not using the regular <i>set_value(...)</i> because I read that it automically uses <i>prep_for_form()</i>, which displays in the textarea as the string <i>& euro;</i>, instead of the € sign.
I'm using
Code:
$this->input->post('description');
... without decoding or encoding anything.

Lastly, in my view, I have set the <i>accept-charset</i> like so:
Code:
echo form_open('controller/function, array('accept-charset' => 'ISO-8859-1'));

When I retrieve the POST value, it is a € sign instead of & euro;. So I then convert it back to html using:
Code:
$description = str_replace('€', '&euro;', $description)

Thanks for all the help with this! It was really bugging me.


Messages In This Thread
Euro sign shows as € when form is submitted - by El Forum - 06-27-2012, 03:22 AM
Euro sign shows as € when form is submitted - by El Forum - 06-27-2012, 05:31 AM
Euro sign shows as € when form is submitted - by El Forum - 06-27-2012, 05:57 AM
Euro sign shows as € when form is submitted - by El Forum - 06-28-2012, 04:23 AM
Euro sign shows as € when form is submitted - by El Forum - 06-28-2012, 01:18 PM
Euro sign shows as € when form is submitted - by El Forum - 06-29-2012, 06:27 AM
Euro sign shows as € when form is submitted - by El Forum - 06-30-2012, 01:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB