#26093: makemessages messes up unicode characters on Python 3
--------------------------------------+------------------------------------
     Reporter:  sephii                |                    Owner:  nobody
         Type:  Bug                   |                   Status:  new
    Component:  Internationalization  |                  Version:  1.9
     Severity:  Normal                |               Resolution:
     Keywords:  python3               |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by claudep):

 This issue is related to the way xgettext interprets escape sequences in
 Python source files.
 `u'sequence: \xa0'` (note the prefix) is interpreted as an ending unicode
 non-breaking space (correct).
 `'sequence: \xa0'` (without the prefix) is interpreted as an ending \xa0
 byte (which is non-valid UTF-8).
 There are not many characters that %r outputs as an escape, but the non-
 breaking space is still an important use case.

 So xgettext is still interpreting strings in the Python 2 way, as it
 cannot differentiate between Python versions by simply reading the source
 file.

 A possible workaround would be to force outputting the `u''` prefix on
 Python 3 when we templatize templates during the extraction process.

--
Ticket URL: <https://code.djangoproject.com/ticket/26093#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.6b858b6a37d5eb430a85486665572c23%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to