Welcome Guest, Not a member yet? Register   Sign In
Experiencing a problem with UTF-8 and diacritics (characters with accents, etc.)
#3

[eluser]tinawina[/eluser]
Hi and thanks for your reply. I've continued to try to fix this problem. To simplify things I created a single text input form that you can see here: http://www.issuelab.org/lb_test. Here's the contents of the controller:

This sets up the form:

Code:
function index()
{
  $rules['title']  = "required";
  $fields['title']  = 'Title';

  $this->validation->set_rules($rules);
  $this->validation->set_fields($fields);

  $this->validation->set_error_delimiters('<span class="error">', '</font>');

  if ($this->validation->run() == false)
  {
   echo $this->the_form();
  }
  else
  {
   echo $this->input->post('title');
  }
}

This sets up the view which I simply echo to the screen:

Code:
function the_form()
{
  $string = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="/lb_test/index" method="post" accept-charset="utf-8"&gt;
  <p>
   Title: &lt;input type="text" name="title" id="title" accept-charset="utf-8" size="75" value="" /&gt;
  </p>
  <p>
   &lt;input type="submit" name="submit" value="Search for duplicates" /&gt;
  </p>
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;';
  return $string;
}

When I input "años son sobresalientes sólo existía un puñado" into the input box and click submit, I get back "años son sobresalientes sólo existía un puñado".

Any ideas about why this is - most appreciated!


Messages In This Thread
Experiencing a problem with UTF-8 and diacritics (characters with accents, etc.) - by El Forum - 03-21-2012, 08:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB