title: What is the equivalent to b'string' on a variable?
body: <p>I need to encode a string of text before using it, but the only problem is it is a variable and all I know is that normally I would use b'string'.  I assume I would use variable.encode(), but what encoding would I use?</p>
  
  <p>EDIT: Sorry, I misunderstood the issue and Christian's answer helped me realize what was going on.  Thanks to everyone for helping.</p>