Ticket #6682 (new defect)

Opened 13 months ago

Last modified 7 months ago

Support non-ASCII characters in Sage sources

Reported by: robertwb Owned by: tbd
Priority: major Milestone: sage-4.5.3
Component: build Keywords:
Cc: mvngu Author(s):
Report Upstream: N/A Reviewer(s):
Merged in: Work issues:

Description (last modified by mpatel) (diff)

This involves at least fixing the documentation build process and trac to support utf-8. Possibly other components as well.

Discussion in  August 2009.

More recent discussion  here.

Attachments

prependify.py Download (1.5 KB) - added by mpatel 7 months ago.
Script to prepend coding to .py(x) files. Not a patch.

Change History

Changed 7 months ago by mpatel

Script to prepend coding to .py(x) files. Not a patch.

Changed 7 months ago by mpatel

  • cc mvngu added
  • upstream set to N/A

From my brief experience with Unicode in SageNB sources (#7249 adds them to doctests), we may just need to

  • Prepend # -*- coding: utf-8 -*- to every .py file. I assume we should do this for .pyx files, too. I've attached a script Download that can do this, although I'm sure there are more succinct ways.
  • Use unicode strings for docstrings that contain non-ASCII Unicode characters. For example,
    def f(n):
        u"""
        Transmogrifies ``n``, heinously. ☺
        """
        return transmogrify(n, algorithm='heinous')

Note: At #8000, Minh suggested polling sage-devel about allowing non-ASCII characters in Sage library code. I'll try to do this soon.

Changed 7 months ago by mpatel

  • description modified (diff)
Note: See TracTickets for help on using tickets.