Python Forum

Full Version: "³" math cube symbol encoding
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am using the package pyuff to read a unv file.
I have the following error
Quote:UnicodeDecodeError: 'ascii' codec can't decode byte 0xb3 in position 770: ordinal not in range(128)

After checking I figured out it is coming from
Quote:m³/s
, the cube symbol is not supported by ascii codecs (I believe it is ascii extended).

How can I fix this please.

Cheers.
Use Unicode
(Mar-09-2018, 02:21 PM)wavic Wrote: [ -> ]Use Unicode
Would you please give some details. These are the lines I am using
Quote:py> import pyuff
py> f=pyuff.UFF('path to file...')
py> f.read_sets(0)
pyuff module has no Unicode support.
Quote:An UFF file is a file that can have many data-sets of either ascii or binary
data where data-set is a block of data between the start and end tags ''____-1''
'' _ ''representing the space character). Refer to [1]_ and [2]_ for
more information about the UFF format.
(Mar-09-2018, 03:48 PM)snippsat Wrote: [ -> ]'' _ ''representing the space character). Refer to [1]_ and [2]_ for
Thank you for your comment but I don't see how it is helping me. I am using the module to read an official unv file and it doesn't work because of the power symbol.
The first question is which exact python statement and expression creates the error. Can you post the whole error traceback?