adasilva / prettytable

code.google.com/p/prettytable with extra formatting options
Other
1 stars 2 forks source link

no true unicode support #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use a unicode object containing non-ASCII characters anywhere in a table.

What is the expected output? What do you see instead?
Either UnicodeEncodeError or UnicodeDecodeError.

What version of the product are you using? On what operating system?
Both 0.5 and trunk.

Please provide any additional information below.
There are tons of 'unicode' function calls without the 'encoding' argument 
throughout the code, and any string or 
unicode object containing non-ASCII characters ruins everything.

Attached a very dumb patch, which just adds a little bit smarter '_unicode' and 
replaces all 'unicode' calls with 
'_unicode'.

I believe a more clever approach is possible, like converting values once 
they're being added (via constructor or 
'add_row') thus reducing number of calls to 'unicode' or whatever.

Original issue reported on code.google.com by ru.w31...@gmail.com on 27 Apr 2010 at 4:59

Attachments:

GoogleCodeExporter commented 8 years ago
Is there a problem with the patch since this is still outstanding?

Original comment by soren@linux2go.dk on 26 Jun 2011 at 3:54

GoogleCodeExporter commented 8 years ago
Sorry for my slow response on processing this patch.  There are no problems 
with it as far as I know.  I will try to get it integrated in the repository 
sometime this week.

Original comment by lmaur...@gmail.com on 3 Jul 2011 at 4:37

GoogleCodeExporter commented 8 years ago
Fixed in trunk.  Thank you for reporting and sorry for the delay!

I will probably make further changes in trunk in the near future to solve this 
problem in a more elegant way.

Original comment by luke@maurits.id.au on 9 Jul 2011 at 9:48