Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
7a6debe7
Kaydet (Commit)
7a6debe7
authored
Eki 15, 2011
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove some duplication
üst
ab7e2a44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
unicodeobject.c
Objects/unicodeobject.c
+4
-10
No files found.
Objects/unicodeobject.c
Dosyayı görüntüle @
7a6debe7
...
@@ -2838,6 +2838,10 @@ normalize_encoding(const char *encoding,
...
@@ -2838,6 +2838,10 @@ normalize_encoding(const char *encoding,
char *l;
char *l;
char *l_end;
char *l_end;
if (encoding == NULL) {
strcpy(lower, "utf-8");
return 1;
}
e = encoding;
e = encoding;
l = lower;
l = lower;
l_end = &lower[lower_len - 1];
l_end = &lower[lower_len - 1];
...
@@ -2869,9 +2873,6 @@ PyUnicode_Decode(const char *s,
...
@@ -2869,9 +2873,6 @@ PyUnicode_Decode(const char *s,
Py_buffer info;
Py_buffer info;
char lower[11]; /* Enough for any encoding shortcut */
char lower[11]; /* Enough for any encoding shortcut */
if (encoding == NULL)
return PyUnicode_DecodeUTF8(s, size, errors);
/* Shortcuts for common default encodings */
/* Shortcuts for common default encodings */
if (normalize_encoding(encoding, lower, sizeof(lower))) {
if (normalize_encoding(encoding, lower, sizeof(lower))) {
if ((strcmp(lower, "utf-8") == 0) ||
if ((strcmp(lower, "utf-8") == 0) ||
...
@@ -3101,13 +3102,6 @@ PyUnicode_AsEncodedString(PyObject *unicode,
...
@@ -3101,13 +3102,6 @@ PyUnicode_AsEncodedString(PyObject *unicode,
return NULL;
return NULL;
}
}
if (encoding == NULL) {
if (errors == NULL || strcmp(errors, "strict") == 0)
return _PyUnicode_AsUTF8String(unicode, NULL);
else
return _PyUnicode_AsUTF8String(unicode, errors);
}
/* Shortcuts for common default encodings */
/* Shortcuts for common default encodings */
if (normalize_encoding(encoding, lower, sizeof(lower))) {
if (normalize_encoding(encoding, lower, sizeof(lower))) {
if ((strcmp(lower, "utf-8") == 0) ||
if ((strcmp(lower, "utf-8") == 0) ||
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment