"Daniel" <daniel.chaow...@gmail.com> wrote

Caveat, I know nothing about SUDS.

rawByte = "PGh0bWw+PGhlYWQ+PG1ldGEgaHR0cC1lcXVpdj0iY29udGVudC10eXBlIiBjb2

the problem is I need to convert the rawByte from string to bytes, then
explain it as text with encoding (like "UTF-8").

A string is a collection of bytes. What you see when you print a string is
just the interpretation of those bytes as characters. So the real question
is how do you want to interpret the bytes? What do the bytes represent?

For example are they in a different character encoding, perhaps unicode?
In that case simple changing the string encoding (and locale serttings?)
should enable you  to print them as a string.

Or do they represent binary data such as numbers or objects that need
to be extracted and then turned into string representation. In that case
you may need to use the struct module.

It all depends on what the bytes actually represent.

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to