Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#1766 closed defect (fixed)

PageOutline macro does not work for non-English pages

Reported by: MishaS Owned by: Jonas Borgström
Priority: normal Milestone: 0.9
Component: wiki system Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I have a page in Russian, which uses '=' and '==' for headers. When the page was complete, I added [[PageOutline]] macro to the page, the following error is produced:

 Error: Macro PageOutline() failed

  'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

(I'm using some 0.9pre version)

Attachments (0)

Change History (3)

comment:1 by Christian Boos, 19 years ago

Milestone: 0.9
Resolution: fixed
Status: newclosed

Fixed in r1922. I should find a way to add an unit-test for the [[PageOutline]] macro, however.

comment:2 by Shun-ichi Goto <gotoh@…>, 19 years ago

Resolution: fixed
Status: closedreopened

Fix in r1922 is not enough. This fix cuase unicode error on my japanese page. The anchor_base should be encoded, also.

--- formatter.py	(revision 1930)
+++ formatter.py	(working copy)
@@ -350,7 +350,7 @@
             # an ID must start with a letter in HTML
             anchor = 'a' + anchor
         i = 1
-        anchor = anchor.encode('utf-8')
+        anchor = anchor_base = anchor.encode('utf-8')
         while anchor in self._anchors:
             anchor = anchor_base + str(i)
             i += 1

I don't know that holding _anchors[] as encoded bytes is correct. But at least, with patch above, my page and PageOutline macro would be work.

comment:3 by Shun-ichi Goto <gotoh@…>, 19 years ago

Resolution: fixed
Status: reopenedclosed

Sorry, this is already fixed in [1931] while I'm checking. :-)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.