Skip to content

Commit

Permalink
Update pycatfile.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KazukiPrzyborowski authored Jan 26, 2025
1 parent 9c951fe commit c785e9c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pycatfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,13 @@ def __exit__(self, exc_type, exc_value, traceback):
self.close()


def ConvertEncoding(text, from_encoding, to_encoding):
"""Converts a string from one encoding to another."""
decoded_text = text.decode(from_encoding)
encoded_text = decoded_text.encode(to_encoding)
return encoded_text


def TarFileCheck(infile):
try:
if is_tarfile(infile):
Expand Down

0 comments on commit c785e9c

Please sign in to comment.