[Phpmyadmin-devel] csv data always enclosed

Marc Delisle DelislMa at CollegeSherbrooke.qc.ca
Wed Sep 5 07:55:05 CEST 2001


Thanks, it works now for my (ordinary) CSV case.
Will you apply it?

Marc

Loïc a écrit :
> 
> 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




More information about the Developers mailing list