﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21725	Javascript translations fail with non-BMP characters	Ned Batchelder	MattBlack	"If a translated string includes a non-BMP character (above 0xFFFF), then javascript_catalog in views/i18n.py fails:

{{{
Traceback (most recent call last):
  File ""/home/ned/.virtualenvs/edx-platform/local/lib/python2.7/site-packages/django/core/handlers/base.py"", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File ""/home/ned/.virtualenvs/edx-platform/local/lib/python2.7/site-packages/django/views/i18n.py"", line 264, in javascript_catalog
    csrc.append(""catalog['%s'] = '%s';\n"" % (javascript_quote(k), javascript_quote(v)))
  File ""/home/ned/.virtualenvs/edx-platform/local/lib/python2.7/site-packages/django/utils/functional.py"", line 176, in wrapper
    return func(*args, **kwargs)
  File ""/home/ned/.virtualenvs/edx-platform/local/lib/python2.7/site-packages/django/utils/text.py"", line 305, in javascript_quote
    return str(ustring_re.sub(fix, s))
UnicodeEncodeError: 'ascii' codec can't encode character u'\U0001d543' in position 31: ordinal not in range(128)
}}}

(this is running 1.4.8, but the javascript_quote code hasn't changed since then.)

It should be possible to fix javascript_quote to turn the character into a surrogate pair."	Bug	closed	Internationalization	1.6	Normal	fixed	nlsprint14	eromijn@…	Ready for checkin	1	0	0	0	0	0
