Opened 3 years ago

Closed 22 months ago

Last modified 19 months ago

#11708 closed defect (fixed)

[Patch] Unicode field names in SQLTable macro

Reported by: theYT <dev@…> Owned by: rjollos
Priority: normal Component: WikiTableMacro
Severity: normal Keywords: unicode
Cc: Trac Release: 1.0


Error occured when using non-ASCII text as field name (as table header). Values are ok.


SELECT 'test' as '한글'

Patch file attached. (tested with r13683)

Attachments (1) (515 bytes) - added by theYT <dev@…> 3 years ago.

Download all attachments as: .zip

Change History (8)

Changed 3 years ago by theYT <dev@…>

comment:1 Changed 3 years ago by jun66j5

No. to_unicode() is not needed. We should use get_column_names() instead of cursor.description directly.

comment:2 Changed 3 years ago by rjollos

Thanks for the feedback. I'll apply a patch that uses get_column_names.

comment:3 Changed 22 months ago by rjollos

  • Status changed from new to accepted

comment:4 Changed 22 months ago by rjollos

  • Resolution set to fixed
  • Status changed from accepted to closed

In 14524:

0.3dev: Use Trac 1.0 DB API.

  • Macro now requires Trac 1.0 and later.
  • Genshi is used to construct the table.
  • Queries can use non-ASCII table names. Fixes #11708.
  • Read-only database connection is used.

Please report any issues with the latest changes.

comment:5 follow-up: Changed 22 months ago by theYT <dev@…>

Checked with [14524]:

  • Trac 1.1.4 database API changes: OK
  • non-ASCII Table names: OK
  • SQLTable macro error (MySQL DB): ticket #12269
  • Now Wiki text field displayed as one-line (format_to_htmlformat_to_oneliner); I don't know which one would be better...

comment:6 in reply to: ↑ 5 Changed 22 months ago by rjollos

Replying to theYT <dev@…>:

  • Now Wiki text field displayed as one-line (format_to_htmlformat_to_oneliner); I don't know which one would be better...

Thank you for reviewing and testing. It seems either format_to_html or format_to_oneliner might be preferred depending on the data being returned.

I made the change to oneliner to avoid the margins on the paragraph, however format_to_html could be used with some CSS to remove the margins (similar to [14529]). Another option would be to support an argument for the WikiProcessor to specify paragraph or oneliner.

comment:7 Changed 19 months ago by rjollos

In 14734:

0.3dev: Partial revert of [14524]. Refs #11708.

Reverts to format_to_html but adds CSS to shrink the cell margins.

Add Comment

Modify Ticket

as closed The owner will remain rjollos.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.