]>
crepu.dev Git - config.git/blob - djavu-asus/emacs/elpy/rpc-venv/lib/python3.11/site-packages/setuptools/unicode_utils.py
5 # HFS Plus uses decomposed UTF-8
7 if isinstance(path
, str):
8 return unicodedata
.normalize('NFD', path
)
10 path
= path
.decode('utf-8')
11 path
= unicodedata
.normalize('NFD', path
)
12 path
= path
.encode('utf-8')
18 def filesys_decode(path
):
20 Ensure that the given path is decoded,
21 NONE when no expected encoding works
24 if isinstance(path
, str):
27 fs_enc
= sys
.getfilesystemencoding() or 'utf-8'
28 candidates
= fs_enc
, 'utf-8'
30 for enc
in candidates
:
32 return path
.decode(enc
)
33 except UnicodeDecodeError:
37 def try_encode(string
, enc
):
38 "turn unicode encoding into a functional routine"
40 return string
.encode(enc
)
41 except UnicodeEncodeError: