T
Tim Cook
Hi All,
I'm not clear on how to use the unicode module.
I need to be able to use certain characters such as the degree symbol
and the mu symbol, i.e.: units = <"°">
if I say units=unicode("°"). I get
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0:
ordinal not in range(128)
If I try x=unicode.decode(x,'utf-8'). I get
TypeError: descriptor 'decode' requires a 'unicode' object but received
a 'str'
What is the correct way to interpret these symbols that come to me as a
string?
Thanks,
Tim
--
**************************************************************************
Join the OSHIP project. It is the standards based, open source
healthcare application platform in Python.
Home page: https://launchpad.net/oship/
Wiki: http://www.openehr.org/wiki/display/dev/Python+developer's+page
**************************************************************************
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQBIe4Fg2TFRV0OoZwMRAjXeAJ4l9st10VFP13lEFUeQwPeN1ZVA6gCgvZTH
CZOvXzqpWmR08I0OmNr5EJs=
=AxgG
-----END PGP SIGNATURE-----
I'm not clear on how to use the unicode module.
I need to be able to use certain characters such as the degree symbol
and the mu symbol, i.e.: units = <"°">
if I say units=unicode("°"). I get
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0:
ordinal not in range(128)
If I try x=unicode.decode(x,'utf-8'). I get
TypeError: descriptor 'decode' requires a 'unicode' object but received
a 'str'
What is the correct way to interpret these symbols that come to me as a
string?
Thanks,
Tim
--
**************************************************************************
Join the OSHIP project. It is the standards based, open source
healthcare application platform in Python.
Home page: https://launchpad.net/oship/
Wiki: http://www.openehr.org/wiki/display/dev/Python+developer's+page
**************************************************************************
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQBIe4Fg2TFRV0OoZwMRAjXeAJ4l9st10VFP13lEFUeQwPeN1ZVA6gCgvZTH
CZOvXzqpWmR08I0OmNr5EJs=
=AxgG
-----END PGP SIGNATURE-----