Jump to content

some changes of my own


Recommended Posts

I wanted to change the import csv file from utf-8 only to handle some standard excel exported files, so I changed the line

bq. $tables[intval($nb_c / MAX_COLUMNS)][$nb_l][$nb_c] = $column;

in AdminImport.php to the following

bq. $tables[intval($nb_c / MAX_COLUMNS)][$nb_l][$nb_c] = utf8_encode($column);

and now it works for me, swedish characters show up correctly. BUT to make this usable by all people, I wanted it to NOT encode the string to utf-8 if it already was utf-8, that way my code would be easy to just copy-paste by the PS team and voíla or croussant the import function would be improved for everyone and I would have made a small contribution ;)

So I set to the task and figured this should work

bq. if(mb_detect_encoding($column,'UTF-8')){$tables[intval($nb_c / MAX_COLUMNS)][$nb_l][$nb_c] = $column;}
else{$tables[intval($nb_c / MAX_COLUMNS)][$nb_l][$nb_c] = utf8_encode($column);}

but it dosn't I just get nothing displayed at all.. I think it has something todo with the mb_detect_encoding function, but I'm not the best php developer, .net is more my strong side so maybe I made some n00b misstake here :)

any inputs on how this could be fixed?
or maybe if someone can tell me how to get error reports during development, that would help also :)

Link to comment
Share on other sites

×
×
  • Create New...