You got me right there
Tutor very much caters to everyone, including Asian users.
I can confirm the issue. With the “notes” plugin enabled, when I create a note with the text “
” it triggers the following error:
notes_1 | Traceback (most recent call last):
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/exception.py", line 34, in inner
notes_1 | response = get_response(request)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/base.py", line 115, in _get_response
notes_1 | response = self.process_exception_by_middleware(e, request)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/base.py", line 113, in _get_response
notes_1 | response = wrapped_callback(request, *callback_args, **callback_kwargs)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
notes_1 | return view_func(*args, **kwargs)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/views/generic/base.py", line 71, in view
nginx_1 | 172.18.0.4 - - [14/Jun/2021:09:36:45 +0000] "PUT /api/v1/annotations/1/ HTTP/1.1" 500 27 "https://demo.openedx.overhang.io/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0" "80.67.176.14"
notes_1 | return self.dispatch(request, *args, **kwargs)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/rest_framework/views.py", line 509, in dispatch
notes_1 | response = self.handle_exception(exc)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/rest_framework/views.py", line 469, in handle_exception
notes_1 | self.raise_uncaught_exception(exc)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
notes_1 | raise exc
notes_1 | File "/usr/local/lib/python3.8/dist-packages/rest_framework/views.py", line 506, in dispatch
notes_1 | response = handler(request, *args, **kwargs)
notes_1 | File "/openedx/edx-notes-api/notesapi/v1/views.py", line 585, in put
notes_1 | note.save()
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 743, in save
notes_1 | self.save_base(using=using, force_insert=force_insert,
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 780, in save_base
notes_1 | updated = self._save_table(
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 853, in _save_table
notes_1 | updated = self._do_update(base_qs, using, pk_val, values, update_fields,
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 903, in _do_update
notes_1 | return filtered._update(values) > 0
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 760, in _update
notes_1 | return query.get_compiler(self.db).execute_sql(CURSOR)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1471, in execute_sql
notes_1 | cursor = super().execute_sql(result_type)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql
notes_1 | cursor.execute(sql, params)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 67, in execute
notes_1 | return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
notes_1 | return executor(sql, params, many, context)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
notes_1 | return self.cursor.execute(sql, params)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 89, in __exit__
notes_1 | raise dj_exc_value.with_traceback(traceback) from exc_value
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
notes_1 | return self.cursor.execute(sql, params)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/mysql/base.py", line 71, in execute
notes_1 | return self.cursor.execute(query, args)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 206, in execute
notes_1 | res = self._query(query)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 319, in _query
notes_1 | db.query(q)
notes_1 | File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 259, in query
notes_1 | _mysql.connection.query(self, query)
notes_1 | django.db.utils.OperationalError: (1366, "Incorrect string value: '\\xF0\\x9F\\x92\\xA9' for column 'text' at row 1")
I agree that changing the collation should fix the issue. But I’m still anxious about changing the database collation. There could be far-reaching impacts that we do not foresee. In the native installation, MySQL runs on utf8_general_ci: configuration/playbooks/roles/mysql/defaults/main.yml at 1909bafde44584ec7bd04f7cb6ee6ac0bfa6b521 · openedx/configuration · GitHub
I think we should try to work with edX on this specific issue. I would like to go to edX with a convincing use case. I think that correctly setting the user name is sufficiently important. @iamCristYe gave a convincing example in the Github issue. However, the "张𠇶 " does not print correctly in any of my computer applications – and not on my phone either. The first character (“zhang”) is fine, but the second prints as an empty square. What character is it exactly? (maybe give a link to a Chinese dictionary) Is that a frequent character/name?