MCPcopy Index your code
hub / github.com/git/git / encodeWithUTF8

Method encodeWithUTF8

git-p4.py:3115–3125  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

3113 self.gitStream.write('\n')
3114
3115 def encodeWithUTF8(self, path):
3116 try:
3117 path.decode('ascii')
3118 except:
3119 encoding = 'utf8'
3120 if gitConfig('git-p4.pathEncoding'):
3121 encoding = gitConfig('git-p4.pathEncoding')
3122 path = path.decode(encoding, 'replace').encode('utf8', 'replace')
3123 if self.verbose:
3124 print('Path with non-ASCII characters detected. Used %s to encode: %s ' % (encoding, path))
3125 return path
3126
3127 def streamOneP4File(self, file, contents):
3128 """Output one file from the P4 stream.

Callers

nothing calls this directly

Calls 1

gitConfigFunction · 0.85

Tested by

no test coverage detected