forked from jelmer/dulwich
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
714 additions
and
253 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Encoding | ||
======== | ||
|
||
You will notice that all lower-level functions in Dulwich take byte strings | ||
rather than unicode strings. This is intentional. | ||
|
||
Although `C git`_ recommends the use of UTF-8 for encoding, this is not | ||
strictly enforced and C git treats filenames as sequences of non-NUL bytes. | ||
There are repositories in the wild that use non-UTF-8 encoding for filenames | ||
and commit messages. | ||
|
||
.. _C git: https://github.com/git/git/blob/master/Documentation/i18n.txt | ||
|
||
The library should be able to read *all* existing git repositories, | ||
irregardless of what encoding they use. This is the main reason why Dulwich | ||
does not convert paths to unicode strings. | ||
|
||
A further consideration is that converting back and forth to unicode | ||
is an extra performance penalty. E.g. if you are just iterating over file | ||
contents, there is no need to consider encoded strings. Users of the library | ||
may have specific assumptions they can make about the encoding - e.g. they | ||
could just decide that all their data is latin-1, or the default Python | ||
encoding. | ||
|
||
Higher level functions, such as the porcelain in dulwich.porcelain, will | ||
automatically convert unicode strings to UTF-8 bytestrings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ Tutorial | |
:maxdepth: 2 | ||
|
||
introduction | ||
encoding | ||
file-format | ||
repo | ||
object-store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.