Prepare charset
This commit is contained in:
parent
224c7b1847
commit
2742da2379
@ -86,6 +86,8 @@ class ImportCsv extends ModeleImports
|
|||||||
|
|
||||||
public $nbupdate = 0; // # of update done during the import
|
public $nbupdate = 0; // # of update done during the import
|
||||||
|
|
||||||
|
public $charset = '';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|||||||
@ -75,6 +75,9 @@ class ModeleImports
|
|||||||
|
|
||||||
public $libversion = array();
|
public $libversion = array();
|
||||||
|
|
||||||
|
public $charset;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array Element mapping from table name
|
* @var array Element mapping from table name
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -142,6 +142,7 @@ $endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : '');
|
|||||||
$updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array());
|
$updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array());
|
||||||
$separator = (GETPOST('separator', 'alphanohtml') ? GETPOST('separator', 'alphanohtml', 3) : '');
|
$separator = (GETPOST('separator', 'alphanohtml') ? GETPOST('separator', 'alphanohtml', 3) : '');
|
||||||
$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); // We must use 'nohtml' and not 'alphanohtml' because we must accept "
|
$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); // We must use 'nohtml' and not 'alphanohtml' because we must accept "
|
||||||
|
$charset = GETPOST('charset', 'aZ09');
|
||||||
$separator_used = str_replace('\t', "\t", $separator);
|
$separator_used = str_replace('\t', "\t", $separator);
|
||||||
|
|
||||||
$objimport = new Import($db);
|
$objimport = new Import($db);
|
||||||
@ -802,6 +803,7 @@ if ($step == 4 && $datatoimport) {
|
|||||||
if ($model == 'csv') {
|
if ($model == 'csv') {
|
||||||
$obj->separator = $separator_used;
|
$obj->separator = $separator_used;
|
||||||
$obj->enclosure = $enclosure;
|
$obj->enclosure = $enclosure;
|
||||||
|
$obj->charset = '';
|
||||||
}
|
}
|
||||||
if ($model == 'xlsx') {
|
if ($model == 'xlsx') {
|
||||||
if (!preg_match('/\.xlsx$/i', $filetoimport)) {
|
if (!preg_match('/\.xlsx$/i', $filetoimport)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user