germyrinn added a comment.
Herald added a subscriber: Charusso.

Python makes a clear distinction between bytes and strings . Bytes objects 
contain raw data — a sequence of octets — whereas strings are Unicode sequences 
. Conversion between these two types is explicit: you encode a string to get 
bytes, specifying an encoding (which defaults to UTF-8); and you decode bytes 
to get a string. Clients of these functions should be aware that such 
conversions may fail, and should consider how failures are handled.

We can convert bytes to string <http://net-informations.com/python/iq/byte.htm> 
using bytes class decode() instance method, So you need to decode the bytes 
object to produce a string. In Python 3 , the default encoding is "utf-8" , so 
you can use directly:

  b"python byte to string".decode("utf-8")




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71746/new/

https://reviews.llvm.org/D71746



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to