I am in a danmark website project. When I used this module import a csv taxonomy list to drupal, I found some chars are not support by this module.
I have fixed what happend, and I will give you an advise, but I think the author of this module maybe have better idea.
First of all, I will describ why:
Because the core function fgetcsv depend on OS and OS's locale settings. so, I think here should be more flexable.
What I do is:
in file:taxonomy_csv.api.inc
about line:469
$line = fgetcsv($handle, 32768, $options['delimiter'], $options['enclosure']);
I changed it to :
$locale = setlocale(LC_CTYPE, 0);
setlocale(LC_CTYPE, 'en_DK.utf8');
$line = fgetcsv($handle, 32768, $options['delimiter'], $options['enclosure']);
setlocale(LC_CTYPE, $locale);
because en_DK.utf8 is my OS locale setting.
It is a ugly patch, what I wish is that it should be a setting for administrator.
Comments
Comment #1
Daniel_KM CreditAttribution: Daniel_KM commentedHi,
Thanks for your code.
Other non-latin people have post same issues in the past. I say them to use an enclosure (
"
) and it solves problem.Nevertheless, I'm going to add an option to set local before import and to reset after. New release of Taxonomy csv for Drupal 7 will be committed during this week.
Sincerely,
Daniel Berthereau
Knowledge manager
Comment #2
vipzhicheng CreditAttribution: vipzhicheng commentedYes, your decision is wrong, because a lot of csv will not be generated by myself, and alway from my clients, so if I must use an enclosure, it will be meaningless to me, lol, thanks for your work.
Comment #3
Daniel_KM CreditAttribution: Daniel_KM commentedHi,
New releases of Taxonomy csv Import/Export for Drupal 6 and Drupal 7 integrate your patch (and some other improvements). You can now set your locale before import if you need it.
Sincerely,
Daniel Berthereau
Knowledge Manager
Comment #4
Daniel_KM CreditAttribution: Daniel_KM commented