English Language problem - Apostrophes - RESOLVED

Talk about Multi-Language tricks, problems, errors etc.

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

daviddelmonte
Master
Master
Posts: 159
Joined: Feb 23rd, '10, 15:06

English Language problem - Apostrophes - RESOLVED

Postby daviddelmonte » Jun 16th, '10, 10:09

RESOLVED - After fixing the items noted in this thread, I had only to erase and re-enter the field and all was well..


I have a record with a field containing an apostrophe

In mySQl, the field appears ok:

"Jimmy's House"

In datagrid, the field appears as

"Jimmy\'s House"

Is there a way to fix this?

Thanks!
Last edited by daviddelmonte on Jun 23rd, '10, 21:24, edited 1 time in total.

administrator
Site Admin
Site Admin
Posts: 5992
Joined: Jan 7th, '09, 23:18
Contact:

Re: English Language problem - Apostrophes

Postby administrator » Jun 16th, '10, 17:54

No, but why you need this?

daviddelmonte
Master
Master
Posts: 159
Joined: Feb 23rd, '10, 15:06

Re: English Language problem - Apostrophes

Postby daviddelmonte » Jun 16th, '10, 18:14

Hi. the client does not want the field to look like this:

"Freddy\'s House"

daviddelmonte
Master
Master
Posts: 159
Joined: Feb 23rd, '10, 15:06

Re: English Language problem - Apostrophes

Postby daviddelmonte » Jun 17th, '10, 02:45

Someone has suggested entering the following code snippet:

Code: Select all

if (get_magic_quotes_gpc()) {
    function stripslashes_deep($value)
    {
        $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
        return $value;
    }

    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
    $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
}
Do you agree and if so, where should it go?

Thanks!!



administrator
Site Admin
Site Admin
Posts: 5992
Joined: Jan 7th, '09, 23:18
Contact:

Re: English Language problem - Apostrophes

Postby administrator » Jun 17th, '10, 08:28

DataGrid may store data with apostrophes and retrieve data without them. But if you need to show this data on third side, simply use something like:
str_replace("\'", "'", $data) or stripslashes() function of php

daviddelmonte
Master
Master
Posts: 159
Joined: Feb 23rd, '10, 15:06

Re: English Language problem - Apostrophes

Postby daviddelmonte » Jun 17th, '10, 09:09

Hi. thanks for your answer. The apostrophe is wrong. If I look at the data in phpmyadmin, the apostrophe is not there.Somehow it only shows in Datagrid..

If I was to use the code you sent me (Thank you!!), where would I place the code?


Return to “Multi-Language implementation”