External Database encoding problem

External Database encoding problem

by hassan farhadi -
Number of replies: 0

Dear Moodle Users,

I use External Database  Enrolment in my Moodle (2.5 & 2.4) for create course, my language is Arabic and my database is MSSql, I use mssqlnative for database driver,
after sync I got blow error in PHP log, I known my problem is about encoding, I use UTF-8 in external database setting, but course create not working, But with English title for course, I don't have any problem and just I have problem with Arabic lang,
please help me

[20-Nov-2013 13:47:35 Europe/Berlin] sqlsrv_query: SQLSTATE = IMSSP
[20-Nov-2013 13:47:35 Europe/Berlin] sqlsrv_query: error code = -46
[20-Nov-2013 13:47:35 Europe/Berlin] sqlsrv_query: message = An error occurred translating the query string to UTF-16: No mapping for the Unicode character exists in the target multi-byte code page.
.
[20-Nov-2013 13:47:35 Europe/Berlin] Default exception handler: Error reading from database Debug: SQLState: IMSSP<br>
Error Code: -46<br>
Message: An error occurred translating the query string to UTF-16: No mapping for the Unicode character exists in the target multi-byte code page.
.<br>

SELECT TOP 1 'x' FROM mdl_course WHERE shortname = N'áÇáÝ'
[array (
0 => 'áÇáÝ',
)]
Error code: dmlreadexception
* line 426 of \lib\dml\moodle_database.php: dml_read_exception thrown
* line 260 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
* line 367 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
* line 779 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
* line 1674 of \lib\dml\moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql()
* line 1659 of \lib\dml\moodle_database.php: call to moodle_database->record_exists_sql()
* line 1643 of \lib\dml\moodle_database.php: call to moodle_database->record_exists_select()
* line 706 of \enrol\database\lib.php: call to moodle_database->record_exists()
* line 77 of \enrol\database\cli\sync.php: call to enrol_database_plugin->sync_courses()

 

Thanks a lot

Average of ratings: -