[Phpmyadmin-devel] csv data always enclosed

Loïc loic-div at ifrance.com
Wed Sep 5 06:29:05 CEST 2001


Marc wrote:

>Is there a reason to force the double-quotes?

Not at all. With the note Benjamin sent yesterday,
this part of the script should be rewritten this way:

// Handles the "separator" and the optionnal "enclosed by" characters
if (!isset($sep)) {
    $sep = '';
} else if ($what == 'excel') {
    $sep     = ';';
} else {
    if (get_magic_quotes_gpc()) {
        $sep = stripslashes($sep);
    }
    $sep     = str_replace('\\t', "\011", $sep);
}
if (!isset($enc_by)) {
    $enc_by = '';
} else if ($what == 'excel') {
    $enc_by     = '"';
} else if (get_magic_quotes_gpc()) {
    $enc_by  = stripslashes($enc_by);
}
if (!isset($esc_by)) {
    $enc_by = '';
} else if (($esc_by == '' && $enc_by !='')
              || $what == 'excel') {
    // double the "enclosed by" character
    $esc_by  = $enc_by;
} else if (get_magic_quotes_gpc()) {
     $esc_by  = stripslashes($esc_by);
}

At least, I think so!

Loïc

 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif






More information about the Developers mailing list