3

I'm recently having an issue importing a csv file of new products (system>import/export>import). I select entity type: Products, Import Behavior: Append Complex Data, then I add my csv file.

After checking the data, I get the following error: Notice: iconv_strlen() [function.iconv-strlen]: Detected an illegal character in input string in /home/MYDOMAIN/public_html/app/code/core/Mage/Core/Helper/String.php on line 86

When looking at this line, it shows the following:

public function strlen($string)
    {
        return iconv_strlen($string, self::ICONV_CHARSET);
    }

I've triple checked my csv file for characters that could potentially set off an error, but I'm struggling to find anything.

  • 1
    Perhaps add the CSV? Too much that could go wrong. Or the line that goes wrong at the very least. – JELLEJ Feb 17 '15 at 18:05
  • Where should I add it? – Eric Fox Feb 17 '15 at 19:52
  • So clear system.log, add Mage::log($string) above the return statement. Enable logging in admin. The notice will end up in the system log and the offending string will be above it. If you still can't figure out what the offending character is, paste the offending line as best as possible and we'll try to help. – Melvyn Feb 17 '15 at 20:06
  • I'm getting DEBUG (7) about 1,000 times. Next to the debug (7) is populated by the SKU, UPC, Long Description, Short Description, Meta Title, Meta Description, name & URL Key. – Eric Fox Feb 17 '15 at 20:51
2

Open your CSV file in Open Office where you have control over the save options. Now save the file specifying UTF-8 and making sure you have the correct field breaks (, or \t).

Read the file now and there should not be any character set problems.

  • It turns out that the issue wasn't related to the csv file (which I knew it wasn't). It was due to a poorly designed theme that I purchased and deleted (got a refund). – Eric Fox May 12 '15 at 16:34
0

Okay so i want to make this accepted answer to be more clear:
You need to open the file, then do what ever you want (edit the file, etc ...), then ctrl + shift + S to save it to a new file. Then after you ctrl + shift + S, it will open a tab like this, make sure you choice this "edit filter setting" enter image description here

Then click save, it will render another tab, make sure you choice this Unicode(UTF-8). enter image description here

That's it. This part take a day of me to figure it out. Hope it help some one. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.