The Oracle database is set to AL32UTF8, and the data within is correctly stored using UTF-8. I've noticed (but am not sure if it matters) that within the Moodle MySQL database, character_set_server is set to latin1 and collation_database is set to latin1_swedish_ci. All tables within the MySQL "moodle" database, and any text columns within those tables, all have a collation value of utf8_unicode_ci. The external authentication plugin is set to use oci8.
- With usernames that don't contain accented characters, authentication via Oracle works fine.
- When users attempt to authenticate with a username that contains anything outside abcdef...z, authentication fails.
In the external database authentication plugin settings, External db encoding is set to utf-8. The password is a SHA-1 hash, which is presumably why accented characters in passwords haven't caused an issue.
Having discovered the issue, I added the following lines to /etc/profile.d/oracle.sh (an executable file):
export NLS_LANG=ENGLISH_UNITED\ KINGDOM.AL32UTF8
and rebooted. Doing a SET at the command line confirms that the NLS_LANG parameter is being set correctly, but this hasn't resolved the issue.
I'm not sufficiently knowledgeable about Moodle to know how to execute ad-hoc queries against Oracle, so can't see exactly what results are being returned by the database.
Can anyone please give me any pointers on where we might be going wrong? Thank you!