summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 31967dd..4839eb1 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -159,9 +159,10 @@ TOEXEC = 0o001 # execute/search by other
#---------------------------------------------------------
# initialization
#---------------------------------------------------------
-ENCODING = sys.getfilesystemencoding()
-if ENCODING is None:
- ENCODING = "ascii"
+if os.name in ("nt", "ce"):
+ ENCODING = "utf-8"
+else:
+ ENCODING = sys.getfilesystemencoding()
#---------------------------------------------------------
# Some useful functions