UTF8 import... å ä ö not working

  • Posts: 5
  • Thank you received: 0
10 years 2 months ago #141548

-- url of the page with the problem -- : server.wnmedia.se/dahls/
-- HikaShop version -- : 2.2.2
-- Joomla version -- : 3.2.1
-- PHP version -- : 5.4.4
-- Browser(s) name and version -- : Firefox 26
-- Error-message(debug-mod must be tuned on) -- : Wrong signs for swedish å ä ö

I have an exported CSV wiht lots of products ... when I open it in Notepad ++ i looks fine. Swedish å ä ö are fine. But when I import it I get strange signs.

Is there anything that I need to do to get the correct UTF when importing?

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
10 years 2 months ago #141571

Sorry this should be in import & export forum

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
10 years 2 months ago #141584

Please provide your CSV file.

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
10 years 2 months ago #141641

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
10 years 2 months ago #141674

The characters of the CSV display fine for the CSV and are detected as UTF8 by my CSV reader. So make sure that you select the UTF8 charset encoding in the import screen before clicking on import and it should work fine.

Please Log in or Create an account to join the conversation.

  • Posts: 39
  • Thank you received: 0
10 years 1 month ago #145511

Hi when I export data from the database to csv file in Russian words are displayed like this å äå ä can you tell me where I can change the UTF8 encoding to UTF-8 or please help how to fix this error?

Last edit: 10 years 1 month ago by Мыктыбек.

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
10 years 1 month ago #145618

If the characters are not correct when you open your CSV that you exported via HikaShop, the problem is with your CSV reader which doesn't open the CSV file in UTF8.
If you use notepad++ to open the file, you should see the characters fine.
So I would recommend you to contact the support of your CSV reader software for help on how to open a CSV file in UTF8 with their software.

Please Log in or Create an account to join the conversation.

  • Posts: 39
  • Thank you received: 0
10 years 1 month ago #145640

Hi can you give me directory export.php or i don't know what is name this file i want change php code please or where i can change this encoding utf8 for example to windows 1251?

Last edit: 10 years 1 month ago by Мыктыбек.

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
10 years 1 month ago #145733

Hi there,

It's not gonna be easy but here is what you are looking for:
administrator/components/com_hikashop/views/product/tmpl/export.php

Look at the end of the file.
You could use the function change of encoding.php (in the helper folder).
But it's complicate while you could use something else to read your csv.

Please Log in or Create an account to join the conversation.

  • Posts: 39
  • Thank you received: 0
10 years 1 month ago #146225

Hi yes you are right i agree with you it is really difficult and so i have question i want change csv format to xlsx it is possible?

Last edit: 10 years 1 month ago by Мыктыбек.

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 1 month ago #146398

Hi,

The HikaShop export system can create CSV or XLS files.
We do not support the XLSX file format.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 39
  • Thank you received: 0
10 years 1 month ago #147066

Hi and where i can change this format csv to xls?

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 1 month ago #147095

Hi,

In the view "backend | your_backend_template | product | export" you will find this line:

$format = $config->get('export_format','csv');
So you can override the view in order to change the default value from "csv" to "xls" or you can create a new entry in the table hikashop_config for the key "export_format".
I forgot that the option is an "hidden option", there is no visible interface in the HikaShop configuration for that because it is very specific feature.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 260
  • Thank you received: 25
7 years 9 months ago #245192

Hi, I am having similar issues with the export import that results in strange characters is accented letters used.

My products (photography) has English, French and Swedish characters for relevant products.

I thought the issue was with Open Calc which I use but it appears it is something within the system.

Here is my work through to test.
I have a product with the words Musée du Louvre in title, description etc:
If I export that product, save it without opening in any program see below

File Attachment:

File Name: hikashop-e...test.csv
File Size:7 KB
)
Then if I import that file straight away (without opening it in any program); the accents for that phrase becomes (Musée du Louvre) - See below

File Attachment:

File Name: hikashop-e...st-2.csv
File Size:7 KB


So while I have been pulling my hair out for a few hours thinking it was OpanCalc, it appears not to be the case. The same appears for Swedish words with accents.

Any thoughts on this greatly appreciated

Simon


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'
Attachments:
Last edit: 7 years 9 months ago by sambob. Reason: neatening up

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
7 years 9 months ago #245245

Hi,

HikaShop exports the CSVs with the UTF8 encoding which supports all the characters.
But I can see that your CSV already has characters with a wrong encoding in the hikashop-export-import-test.csv file : take.ms/UeMzo
That is already like that in your database and wasn't done by the export. You can see that the other accents display fine in your CSV.

So I'm thinking that the problem might be when you import the CSV. Did you select the UTF8 encoding when you did the import ?

Please Log in or Create an account to join the conversation.

  • Posts: 260
  • Thank you received: 25
7 years 9 months ago #245266

Hi Nicholas,

Thanks for looking into this.

That erroneous character group is because I must have missed correcting that particular field (the alias) when I did the test.

Importing as utf8. - remember that file that I imported was unchanged from the export (i.e. not opened so whatever the encoding at export is the same at import.

The is something going on with the import but not sure what, why, how.


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

  • Posts: 260
  • Thank you received: 25
7 years 9 months ago #245269

Hi Nicholas, I thought I would do a retest.
First image is the file with the exported product that with the accented characters corrected in the backend. You can see that in both OpenCalc and notepad that characters are as expected.



The second image is the product after the same file above is imported (unopened, unsaved, as it was exported)


Here is the file... there appears to be something happening on import. (Are you able to test import successfully)

File Attachment:

File Name: hikashop-e...ngle.csv
File Size:7 KB


Strange...


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'
Attachments:
Last edit: 7 years 9 months ago by sambob.

Please Log in or Create an account to join the conversation.

  • Posts: 260
  • Thank you received: 25
7 years 9 months ago #245270

Ok... some progress.

If I copy the content of the csv into the 'Import products from text area', and import that way, it imports as expected (with correct accent characters)

So there appears to be a 'glitch' with the 'Import products from CSV' function - but we are getting closer to the issue.

Simon


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
7 years 9 months ago #245268

Hi,

So I've tried to import your CSV on a test website and the texts don't have any accent problem:
take.ms/aCZtC
And if I export again the product, the accents are still correct in the resulting CSV:
take.ms/nmwxy
So besides a wrong manipulation with the files on your end, I don't see what it could be.

Please Log in or Create an account to join the conversation.

  • Posts: 260
  • Thank you received: 25
7 years 9 months ago #245342

Hi Nicolas, thanks for looking into it.

Text import works fine; and when I export it, all accents display as expected.

It is the CVS (file) import which is causing the issue, as mentioned, that file, exported and then directly imported, remained untouched/unopened before re-importing it back in - and the issue appears.

I was thinking and investigating something erroneous in the mysql tables etc, but nothing comes up.

Doing the text import is no big deal, just a couple of clicks with the mouse.

Thanks again for looking into this Nicolas, appreciate it!

Simon


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

Time to create page: 0.116 seconds
Powered by Kunena Forum