728x90 반응형 decoding1 [Python] Unicode and Python: encode and decode Python에서 encode와 decode: str과 bytesencode : str 에서 bytes 로decode : bytes 에서 str 로 이때 encoding 방식이 필요하며,해당 encoding 방식에 따라 동일한 str 객체라도 다른 bytes 객체로 변환된다.참고로, str 객체가 같은 경우엔 Unicode의 codepoint (=코드값)는 같음.하지만, encoding방식에 따라 대응되는 bytes 객체는 다름.bytes 대신 bytearray 도 가능. 참고 : Unicode에서의 encoding이란Unicode에서 문자열은 일종의 sequence of code points 임. (코드값들의 sequence)이를 저장 및 전송, 또는 메모리에 올리기 위해선 일종의 code unit 으로.. 2024. 1. 16. 이전 1 다음 728x90 반응형