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
8d93ca13
Kaydet (Commit)
8d93ca13
authored
Kas 23, 2002
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Verify that the code in CJK UNIFIED IDEOGRAPH- actually denotes an ideograph.
üst
677bde2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
unicodedata.c
Modules/unicodedata.c
+12
-3
No files found.
Modules/unicodedata.c
Dosyayı görüntüle @
8d93ca13
...
...
@@ -580,6 +580,15 @@ static char *hangul_syllables[][3] = {
{
0
,
0
,
"H"
}
};
static
int
is_unified_ideograph
(
Py_UCS4
code
)
{
return
(
(
0x3400
<=
code
&&
code
<=
0x4DB5
)
||
/* CJK Ideograph Extension A */
(
0x4E00
<=
code
&&
code
<=
0x9FA5
)
||
/* CJK Ideograph */
(
0x20000
<=
code
&&
code
<=
0x2A6D6
));
/* CJK Ideograph Extension B */
}
static
int
_getucname
(
Py_UCS4
code
,
char
*
buffer
,
int
buflen
)
{
...
...
@@ -610,9 +619,7 @@ _getucname(Py_UCS4 code, char* buffer, int buflen)
return
1
;
}
if
((
0x3400
<=
code
&&
code
<=
0x4DB5
)
||
/* CJK Ideograph Extension A */
(
0x4E00
<=
code
&&
code
<=
0x9FA5
)
||
/* CJK Ideograph */
(
0x20000
<=
code
&&
code
<=
0x2A6D6
))
{
/* CJK Ideograph Extension B */
if
(
is_unified_ideograph
(
code
))
{
if
(
buflen
<
28
)
/* Worst case: CJK UNIFIED IDEOGRAPH-20000 */
return
0
;
...
...
@@ -743,6 +750,8 @@ _getcode(const char* name, int namelen, Py_UCS4* code)
return
0
;
name
++
;
}
if
(
!
is_unified_ideograph
(
v
))
return
0
;
*
code
=
v
;
return
1
;
}
...
...
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