lastname first name with accents
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.
Updated by Ivan Tcholakov about 9 years ago
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 Anonymous almost 9 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.