Project

General

Profile

Feature #1834

Adding encoding conversion functionality in Import::csv_to_array()

Added by Ivan Tcholakov almost 9 years ago. Updated almost 9 years ago.

Status:
Feature implemented
Priority:
Normal
Category:
-
Target version:
Start date:
05/08/2010
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

The idea comes from the transaction http://code.google.com/p/chamilo/source/detail?r=3aa276a284420e60565ac1e3663548f5830f74e0&repo=classic

Here is a proposal for changes:

1. The method csv_to_array() loads the file first and detects its encoding. There is a convenient function api_detect_encoding().
2. The method csv_to_array() returns an array. Using the detected encoding value and applying conversion, the method makes sure that all of the elements of the result array are under (or use) the system encoding.

After these changes Import::csv_to_array() will be used as usual, without adding code for dealing with encodings for any particular case.

3. Places of code where Import::csv_to_array() is used to be checked abouts unnecessary (after the changes 1. and 2.) encoding conversions.

Comments?

History

#1

Updated by Ivan Tcholakov almost 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Ivan Tcholakov

Ok, I am going to implement this task.

#2

Updated by Ivan Tcholakov almost 9 years ago

  • Status changed from Assigned to Needs more info
  • % Done changed from 0 to 80

12375:fba365d6859b Feature #1834 - Adding encoding detection and encoding conversion functionality in Import::csv_to_array().
http://code.google.com/p/chamilo/source/detail?r=fba365d6859bb435b2ab2b46c55e329e55cd5c59&repo=classic

I did test with the course import page, it works. Julio, could you try your files about users import? They can be with ISO-8859-15 (for example) or UTF-8, nevermind.

#3

Updated by Ivan Tcholakov almost 9 years ago

  • Status changed from Needs more info to Assigned
  • Target version set to 1.8.8 stable
#4

Updated by Ivan Tcholakov almost 9 years ago

  • Status changed from Assigned to Feature implemented
  • % Done changed from 80 to 100

Also available in: Atom PDF