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
3c6d6f2f
Kaydet (Commit)
3c6d6f2f
authored
Eki 01, 2002
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Support UCS-4 builds.
üst
0ba5541a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
8 deletions
+36
-8
_tkinter.c
Modules/_tkinter.c
+36
-8
No files found.
Modules/_tkinter.c
Dosyayı görüntüle @
3c6d6f2f
...
@@ -62,6 +62,14 @@ Copyright (C) 1994 Steen Lumholt.
...
@@ -62,6 +62,14 @@ Copyright (C) 1994 Steen Lumholt.
#error "Tk older than 8.2 not supported"
#error "Tk older than 8.2 not supported"
#endif
#endif
/* Unicode conversion assumes that Tcl_UniChar is two bytes.
We cannot test this directly, so we test UTF-8 size instead,
expecting that TCL_UTF_MAX is changed if Tcl ever supports
either UTF-16 or UCS-4. */
#if TCL_UTF_MAX != 3
#error "unsupported Tcl configuration"
#endif
#if defined(macintosh)
#if defined(macintosh)
/* Sigh, we have to include this to get at the tcl qd pointer */
/* Sigh, we have to include this to get at the tcl qd pointer */
#include <tkMac.h>
#include <tkMac.h>
...
@@ -531,15 +539,35 @@ AsObj(PyObject *value)
...
@@ -531,15 +539,35 @@ AsObj(PyObject *value)
}
}
#ifdef Py_USING_UNICODE
#ifdef Py_USING_UNICODE
else
if
(
PyUnicode_Check
(
value
))
{
else
if
(
PyUnicode_Check
(
value
))
{
/* In Tcl 8.2 and later, use Tcl_NewUnicodeObj() */
Py_UNICODE
*
inbuf
=
PyUnicode_AS_UNICODE
(
value
);
if
(
sizeof
(
Py_UNICODE
)
!=
sizeof
(
Tcl_UniChar
))
{
int
size
=
PyUnicode_GET_SIZE
(
value
);
/* XXX Should really test this at compile time */
/* This #ifdef assumes that Tcl uses UCS-2.
PyErr_SetString
(
PyExc_SystemError
,
See TCL_UTF_MAX test above. */
"Py_UNICODE and Tcl_UniChar differ in size"
);
#ifdef Py_UNICODE_WIDE
return
0
;
Tcl_UniChar
*
outbuf
;
int
i
;
outbuf
=
(
Tcl_UniChar
*
)
ckalloc
(
size
*
sizeof
(
Tcl_UniChar
));
if
(
!
outbuf
)
{
PyErr_NoMemory
();
return
NULL
;
}
}
return
Tcl_NewUnicodeObj
(
PyUnicode_AS_UNICODE
(
value
),
for
(
i
=
0
;
i
<
size
;
i
++
)
{
PyUnicode_GET_SIZE
(
value
));
if
(
inbuf
[
i
]
>=
0x10000
)
{
/* Tcl doesn't do UTF-16, yet. */
PyErr_SetString
(
PyExc_ValueError
,
"unsupported character"
);
ckfree
(
FREECAST
outbuf
);
return
NULL
;
}
outbuf
[
i
]
=
inbuf
[
i
];
}
result
=
Tcl_NewUnicodeObj
(
outbuf
,
size
);
ckfree
(
FREECAST
outbuf
);
return
result
;
#else
return
Tcl_NewUnicodeObj
(
inbuf
,
size
);
#endif
}
}
#endif
#endif
else
{
else
{
...
...
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