Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
codec for byte transparency
#8
i'm working with content that is already UTF-8 encoded, i got in bytes. i'm changing the type to str in a transparent way so that UTF-8 encoding remains unchanged. then i work with it in type str. then i can change it back without any more encoding if i ultimately need it as binary to output it (such as a file open in binary mode). if i am the only one writing the code to work with the content, i'll leave it in type bytes. but often i need to call some other code that expects str.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
codec for byte transparency - by Skaperen - Sep-18-2020, 02:24 AM
RE: codec for byte transparency - by bowlofred - Sep-18-2020, 03:01 AM
RE: codec for byte transparency - by Skaperen - Sep-18-2020, 03:12 AM
RE: codec for byte transparency - by DeaD_EyE - Sep-18-2020, 06:56 AM
RE: codec for byte transparency - by bowlofred - Sep-18-2020, 07:23 AM
RE: codec for byte transparency - by Skaperen - Sep-18-2020, 10:35 PM
RE: codec for byte transparency - by bowlofred - Sep-18-2020, 11:06 PM
RE: codec for byte transparency - by Skaperen - Sep-25-2020, 02:20 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 16: invalid cont Melcu54 3 4,917 Mar-26-2023, 12:12 PM
Last Post: Gribouillis
  [SOLVED] [Debian] UnicodeEncodeError: 'ascii' codec Winfried 1 1,020 Nov-16-2022, 11:41 AM
Last Post: Winfried
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 34: character Melcu54 7 18,840 Sep-26-2022, 10:09 AM
Last Post: Melcu54
  ASCII-Codec in Python3 [SOLVED] AlphaInc 4 6,109 Jul-07-2021, 07:05 PM
Last Post: AlphaInc
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 error from Mysql call AkaAndrew123 1 3,439 Apr-28-2021, 08:16 AM
Last Post: AkaAndrew123
  'utf-8' codec can't decode byte 0xe2 in position 122031: invalid continuation byte tienttt 12 11,509 Sep-18-2020, 10:10 PM
Last Post: tienttt
  'charmap' codec louis216 4 20,145 Jun-30-2020, 06:25 AM
Last Post: louis216
  'utf-8' codec can't decode byte 0xda in position 184: invalid continuation byte karkas 8 31,643 Feb-08-2020, 06:58 PM
Last Post: karkas
  Which codec can help me decode the html source? vivekagrey 4 3,178 Jan-10-2020, 09:33 AM
Last Post: DeaD_EyE
  unicodedecodeerror:utf codec can't decode byte 0xe3 in position 1 mariolopes 3 2,815 Oct-14-2019, 10:17 PM
Last Post: mariolopes

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020