[Python] base64 디코드
·
Development/Python
base64란? : 데이터를 텍스트로 표현하는 인코딩 방식 중 하나이다. 이진 데이터를 64개의 ASCII문자로 이루어진 문자열로 변환한다. 데이터 크기를 약간 늘리는 단점이 있지만, 데이터의 무결성을 보존하고 다양한 시스템 간에 이진 데이터를 안전하게 전송할 수 있는 장점이 있다. import base64 encoded_url = '6dQgMANO9qsfWFmshg0wEv///w==' decoded_url = base64.b64decode(encoded_url).decode('utf-8') `base64.b64decode()` 함수를 사용하여 해당 문자열을 디코드하고 `decode('utf-8')`를 사용하여 바이너리 데이터를 문자열로 변환한다.
유니코드 변환(decode)
·
Development/PHP
# unicode decode function utf8_urldecode($str) { $str = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($str)); return html_entity_decode($str,null,'UTF-8');; } # use $str = utf8_urldecode($str); 참고 : https://www.php.net/manual/en/function.urldecode.php