Noop, but the table I’m importing from is latin1. But tested on another installtion too where:
MODx config:
$database_connection_charset = ’utf8’;
DEFAULT_CHARACTER_SET_NAME
utf8
DEFAULT_COLLATION_NAME
utf8_general_ci
And on the created tables:
Table COLLATION:
utf8_general_ci
I created a snippet with the following content:
$usrObject = $modx->newObject('modUser');
$usrObject->set('username', 'Asa');
$usrObject->save();
$usrObject = $modx->newObject('modUser');
$usrObject->set('username', 'Åsa');
$usrObject->save();
$usrObject = $modx->newObject('modUser');
$usrObject->set('username', 'Ake');
$usrObject->save();
$usrObject = $modx->newObject('modUser');
$usrObject->set('username', 'Öken');
$usrObject->save();
Did not copy any text, wrote it directly in manager to be sure I didn’t pasted something stange.
Got the errors in log as described above and Åsa isn’t created.
If I have a user "Öken" in database and try to create "Oken" in manager I get "Username already in use".
If I create in manager user "Jörgen" I cant’t create "Jorgen" in manager.
EDIT:
If I create directly in the table "Ösa" and "Osa" I get "Duplicate entry "Osa" for key 2"
The error is certenly at database level. Not a MODx problem.
Perhaps I shouldn’t store ÅÄÖ without encoding them in some way? But I’ve done that all the time before without any problem...
Well, I’ll try Google it.
Although not a MODx problem, perhaps someone could give me an advise. Otherwise, I guess I’ll just html encode it before storing the user names.
EDIT#2:
Will this not be a problem for many people when Revo gets more used? In Evo the "username" column in the table isn’t set to unique, it was the php code in the login snippet checking to be sure user name didn’t exist. (At least I think so.)