Bug #2871
closedlastname first name with accents
100%
Description
When I upload a csv file to add users to the system, the names are cut off when there is a letter with accent in the name.
ex. Quitério becomes: Quit (see attachment)
The system accepts letters with accents, because in the user list I can type/edit the name correctly.
This occurs on every testplatform, also the most recent version localy installed.
Files
Updated by Sven Vanpoucke over 12 years ago
Is your upload file in utf-8 encoded?
Updated by Ivan Tcholakov over 12 years ago
Sven,
Probably you use the native PHP functions str_getcsv() (http://php.net/manual/en/function.str-getcsv.php) and fgetcsv() (http://php.net/manual/en/function.fgetcsv.php). These functions are not convenient, because they depend on OS locale. When OS locale is not UTF-8 (in Windows for example) these functions cut all non-ASCII letters. However OS system locale should not be changed, because it is not thread-safe.
In Chamilo 1.8.x we use alternative php-implemented functions. See in chamilo-classic/main/inc/lib/text.lib.php the functions api_str_getcsv() and api_fgetcsv(). They work with UTF-8 (and other encodings) correctly.
Updated by Stefaan Vanbillemont about 12 years ago
- Project changed from Chamilo LCMS Connect to Repository
Updated by Stefaan Vanbillemont about 12 years ago
- Target version changed from 21 to 2.1.0
Updated by Anonymous about 12 years ago
- Status changed from New to Assigned
- Assignee set to Anonymous
Updated by Anonymous about 12 years ago
- Status changed from Assigned to Needs more info
I can only make up that your file is not UTF-8. When I try to import a CSV file exported by chamilo, the file format is UTF-8 according to Notepad++. When I import this file everything works like a charm. If I use Notepad++ to convert the CSV file to ANSI, the name gets cut off on a second import.
Can you try to check the encoding of your CSV file? In Notepad++ you have a separate menu for this where you can convert the file as well, give this a go and provide some feedback for this issue so we can look further into it if necessary.
Updated by Anonymous about 12 years ago
- Status changed from Needs more info to Needs testing
- % Done changed from 0 to 100
Updated by Koen Favere almost 12 years ago
- Status changed from Needs testing to Bug resolved