Is dimensionality.string supposed to return an ascii string?
Hi quantities devs,
I'm just starting to play around with quantities, and I really like it.
I'm trying to print out some quantities, but I'm getting encoding errors. I compiled quantities without the --no-unicode flag, which seems to be causing problems with my text editor (TextMate). I tried to work around this problem by printing quantity.
Was ``dimensionalit
Thanks!
-Tony
Note that this error doesn't occur in the terminal.
System:
Mac OS X 10.5.6
python 2.5.1 (original Leopard install)
numpy 1.3.0
quantities 0.5b2
#------Error message-------
UnicodeDecodeError: ascii, °C, 0, 1, ordinal not in range(128)
function write in codecs.py at line 303
data, consumed = self.encode(object, self.errors)
Warning: It seems that you are trying to print a plain string containing unicode characters. In many contexts, setting the script encoding to UTF-8 and using plain strings with non-ASCII will work, but it is fragile. See also this ticket.
You can fix this by changing the string to a unicode string using the 'u' prefix (e.g. u"foobar").
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Tony S Yu for more information if necessary.