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
8ed91b27
Kaydet (Commit)
8ed91b27
authored
May 29, 2009
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion
of the command line.
üst
e23c8683
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
NEWS
Misc/NEWS
+3
-0
python.c
Modules/python.c
+18
-2
No files found.
Misc/NEWS
Dosyayı görüntüle @
8ed91b27
...
@@ -12,6 +12,9 @@ What's New in Python 3.1 release candidate 1?
...
@@ -12,6 +12,9 @@ What's New in Python 3.1 release candidate 1?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion
of the command line.
- Issue #6012: Add cleanup support to O& argument parsing.
- Issue #6012: Add cleanup support to O& argument parsing.
- Issue #6089: Fixed str.format with certain invalid field specifiers
- Issue #6089: Fixed str.format with certain invalid field specifiers
...
...
Modules/python.c
Dosyayı görüntüle @
8ed91b27
...
@@ -38,8 +38,16 @@ char2wchar(char* arg)
...
@@ -38,8 +38,16 @@ char2wchar(char* arg)
if
(
!
res
)
if
(
!
res
)
goto
oom
;
goto
oom
;
count
=
mbstowcs
(
res
,
arg
,
argsize
+
1
);
count
=
mbstowcs
(
res
,
arg
,
argsize
+
1
);
if
(
count
!=
(
size_t
)
-
1
)
if
(
count
!=
(
size_t
)
-
1
)
{
return
res
;
wchar_t
*
tmp
;
/* Only use the result if it contains no
surrogate characters. */
for
(
tmp
=
res
;
*
tmp
!=
0
&&
(
*
tmp
<
0xd800
||
*
tmp
>
0xdfff
);
tmp
++
)
;
if
(
*
tmp
==
0
)
return
res
;
}
PyMem_Free
(
res
);
PyMem_Free
(
res
);
}
}
/* Conversion failed. Fall back to escaping with surrogateescape. */
/* Conversion failed. Fall back to escaping with surrogateescape. */
...
@@ -75,6 +83,14 @@ char2wchar(char* arg)
...
@@ -75,6 +83,14 @@ char2wchar(char* arg)
memset
(
&
mbs
,
0
,
sizeof
mbs
);
memset
(
&
mbs
,
0
,
sizeof
mbs
);
continue
;
continue
;
}
}
if
(
*
out
>=
0xd800
&&
*
out
<=
0xdfff
)
{
/* Surrogate character. Escape the original
byte sequence with surrogateescape. */
argsize
-=
converted
;
while
(
converted
--
)
*
out
++
=
0xdc00
+
*
in
++
;
continue
;
}
/* successfully converted some bytes */
/* successfully converted some bytes */
in
+=
converted
;
in
+=
converted
;
argsize
-=
converted
;
argsize
-=
converted
;
...
...
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