FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
GitPython/gitdb/gitdb/utils/encoding.py at 3.1.62 · gitpython-developers/GitPython · GitHub
gitpython-developers
GitPython
Repository navigation
Code
Issues
6
(6)
Pull requests
7
(7)
Discussions
Actions
Security and quality
42
(42)
Insights
Expand file tree
Breadcrumbs
GitPython
/
gitdb
/
gitdb
/
utils
/
encoding.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (12 loc) · 372 Bytes
Breadcrumbs
GitPython
/
gitdb
/
gitdb
/
utils
/
encoding.py
Copy path
File metadata and controls
18 lines (12 loc) · 372 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def
force_bytes
(
data
,
encoding
=
"utf-8"
):
if
isinstance
(
data
,
bytes
):
return
data
if
isinstance
(
data
,
str
):
return
data
.
encode
(
encoding
)
return
data
def
force_text
(
data
,
encoding
=
"utf-8"
):
if
isinstance
(
data
,
str
):
return
data
if
isinstance
(
data
,
bytes
):
return
data
.
decode
(
encoding
)
return
str
(
data
,
encoding
)
Back
|
FazBrowse Home
|
New Git URL