Modify

Opened 18 years ago

Closed 17 years ago

#1194 closed defect (fixed)

can't list Chinese tags

Reported by: dlin Owned by: Alec Thomas
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

When I edit some pages with Chinese tags, it can show in tags cloud. But when I click such tag, it occurs following errors:

007-02-09 13:17:13,729 Trac[macros] ERROR: Invalid expression ''?餅?''
Traceback (most recent call last):
  File "/home/dlin/tagsplugin/tractags/macros.py", line 188, in render_listtagged
    expr = Expression(expression)
  File "/home/dlin/tagsplugin/tractags/expr.py", line 35, in __init__
    self.expression = ' '.join(expr)
  File "/usr/local/lib/python2.4/compiler/transformer.py", line 54, in parse
    return Transformer().parseexpr(buf)
  File "/usr/local/lib/python2.4/compiler/transformer.py", line 133, in parseexpr
    return self.transform(parser.expr(text))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-2: ordinal not in range(128)

Attachments (1)

tags-unicode2.diff (3.3 KB) - added by anonymous 18 years ago.

Download all attachments as: .zip

Change History (9)

Changed 18 years ago by anonymous

Attachment: tags-unicode2.diff added

comment:1 Changed 18 years ago by swl181@…

My potential unicode problem fix - tags-unicode2.diff

comment:2 Changed 18 years ago by dlin

It still not solve, it display following error message when I click one Chinese keyword on tags clouds.

'ascii' codec can't encode characters in position 1-2: ordinal not in range(128)

comment:3 Changed 18 years ago by anonymous

On our site, this patch works all right :-).

Please marge this patch into trunk.

comment:4 in reply to:  2 Changed 18 years ago by anonymous

Replying to dlin.tw@gmail.com:

It still not solve, it display following error message when I click one Chinese keyword on tags clouds.

Can you attach full error trace from environment log file?

comment:5 Changed 18 years ago by dlin

2007-04-12 15:24:48,969 Trac[macros] ERROR: Invalid expression ''\xe9\x9b\xbb\xe6\x96\x87''
Traceback (most recent call last):
  File "/home/dlin/tagsplugin/tractags/macros.py", line 188, in render_listtagged
    expr = Expression(expression)
  File "/home/dlin/tagsplugin/tractags/expr.py", line 35, in __init__
    self.expression = (u' '.join(expr)).encode('utf-8')
  File "/usr/local/lib/python2.4/compiler/transformer.py", line 54, in parse
    return Transformer().parseexpr(buf)
  File "/usr/local/lib/python2.4/compiler/transformer.py", line 133, in parseexpr
    return self.transform(parser.expr(text))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-2: ordinal not in range(128)

comment:6 Changed 18 years ago by swl181

I'm experiment little with pluging source code, but I cannot understand why you have such error on your site after applying my patch

comment:7 Changed 18 years ago by dlin

It workable now, I found I forgot to restart apache, that caused the problem. Could you merge tags-unicode2.diff into trunk?

comment:8 Changed 17 years ago by Alec Thomas

Resolution: fixed
Status: newclosed

(In [2488]) Committed patch from dlin.tw@…, thanks. Fixes #1194.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.