Adding encoding conversion functionality in Import::csv_to_array()
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.
Updated by Ivan Tcholakov about 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().
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.