• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Charset, CI or MySQL problem ??? ( or dumb coder problem ??? )

#11
[eluser]Randy Casburn[/eluser]
There is partially, and after this I'm going to submit a bug/suggestion.

The first part of the fix is to the Form Help Class. I'll be asking that they require all forms generated with the form helper respect the char_set encoding declaration provided in the database settings. This would have cut down this and many other problems over the weekend. This is done in the form header by including the HTML keyword [accept-charset = "UTF-8"] inside the <form> tag. Of-course, the char_set would be pulled from the DB config char_set configuration item. in the CI registry.

Now the other part. All you have to do is write a simple parser yourself -> jk...

All you have to do is run your $desc1 and $desc2 through the "String Helpers" quotes_to_entities(); or strip_quotes(); I recommend quotes_to_entities(); like this...

Code:
function update_boot_text($bootID, $number, $name, $type, $desc1, $desc2)
{
    $data = array('catID' => $type, 'Nmbr' => $number, 'Name' => $name, 'desc1' => quotes_to_entities($desc1), 'desc2' => quotes_to_entities($desc2));
    ....

Don't forget to load up the String Helper class.

Randy

#12
[eluser]charlie spider[/eluser]
tried quotes_to_entities() but then i lose my Registered sysmbols

so now i'm going with this:
Code:
$desc1 = $this->input->post('shortDesc');
$desc2 = $this->input->post('longDesc');
                        
$desc1 =  str_replace('”', '"', $desc1);
$desc2 =  str_replace('”', '"', $desc2);
                        
if ($this->Boot_model->update_boot_text(    
        $this->input->post('bootID'),
        $this->input->post('nmbr'),
        $this->input->post('name'),
        $this->input->post('boot_type'),
        htmlentities ( $desc1, ENT_QUOTES, 'UTF-8' ),
        htmlentities ( $desc2, ENT_QUOTES, 'UTF-8' )
    ))

does the job

doesn't really help me understand why this is happening,
but i guess you can't have everything

side note:
i've been searching on websites that list EVERYTHING in the various charsets and i am yet to find that stupid slanted double quote, so i still don't know what it is.

thanks again for all of your help Randy

#13
[eluser]Randy Casburn[/eluser]
check this and follow the tutorial link...might be fruitful.

[url http://ellislab.com/forums/viewthread/83860/]Bug Report On this Topic[/url]


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.