Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
52ea7e92
Commit
52ea7e92
authored
Nov 26, 2002
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #632973: Implement _getdefaultlocale for OS X.
parent
318b7b92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
Modules/_localemodule.c
Modules/_localemodule.c
+3
-3
Python/mactoolboxglue.c
Python/mactoolboxglue.c
+16
-5
No files found.
Modules/_localemodule.c
View file @
52ea7e92
...
@@ -30,7 +30,7 @@ This software comes with no warranty. Use at your own risk.
...
@@ -30,7 +30,7 @@ This software comes with no warranty. Use at your own risk.
#include <windows.h>
#include <windows.h>
#endif
#endif
#if
def macintosh
#if
__APPLE__
#include "macglue.h"
#include "macglue.h"
#endif
#endif
...
@@ -400,7 +400,7 @@ PyLocale_getdefaultlocale(PyObject* self)
...
@@ -400,7 +400,7 @@ PyLocale_getdefaultlocale(PyObject* self)
}
}
#endif
#endif
#if defined(
macintosh
)
#if defined(
__APPLE__
)
static
PyObject
*
static
PyObject
*
PyLocale_getdefaultlocale
(
PyObject
*
self
)
PyLocale_getdefaultlocale
(
PyObject
*
self
)
{
{
...
@@ -627,7 +627,7 @@ static struct PyMethodDef PyLocale_Methods[] = {
...
@@ -627,7 +627,7 @@ static struct PyMethodDef PyLocale_Methods[] = {
METH_VARARGS
,
strcoll__doc__
},
METH_VARARGS
,
strcoll__doc__
},
{
"strxfrm"
,
(
PyCFunction
)
PyLocale_strxfrm
,
{
"strxfrm"
,
(
PyCFunction
)
PyLocale_strxfrm
,
METH_VARARGS
,
strxfrm__doc__
},
METH_VARARGS
,
strxfrm__doc__
},
#if defined(MS_WINDOWS) || defined(
macintosh
)
#if defined(MS_WINDOWS) || defined(
__APPLE__
)
{
"_getdefaultlocale"
,
(
PyCFunction
)
PyLocale_getdefaultlocale
,
METH_NOARGS
},
{
"_getdefaultlocale"
,
(
PyCFunction
)
PyLocale_getdefaultlocale
,
METH_NOARGS
},
#endif
#endif
#ifdef HAVE_LANGINFO_H
#ifdef HAVE_LANGINFO_H
...
...
Python/mactoolboxglue.c
View file @
52ea7e92
...
@@ -38,11 +38,22 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
...
@@ -38,11 +38,22 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
char
*
PyMac_getscript
()
char
*
PyMac_getscript
()
{
{
#if TARGET_API_MAC_OSX
#if TARGET_API_MAC_OSX
/* We cannot use GetSysFont because it requires the window manager
CFStringEncoding
enc
=
CFStringGetSystemEncoding
();
** There are other APIs to query the default 8 bit encoding, but
static
CFStringRef
name
=
NULL
;
** I don't know about them (yet).
/* Return the code name for the encodings for which we have codecs. */
*/
switch
(
enc
)
{
return
"ascii"
;
case
kCFStringEncodingMacRoman
:
return
"mac-roman"
;
case
kCFStringEncodingMacGreek
:
return
"mac-greek"
;
case
kCFStringEncodingMacCyrillic
:
return
"mac-cyrillic"
;
case
kCFStringEncodingMacTurkish
:
return
"mac-turkish"
;
case
kCFStringEncodingMacIcelandic
:
return
"mac-icelandic"
;
/* XXX which one is mac-latin2? */
}
if
(
!
name
)
{
/* This leaks a an object. */
name
=
CFStringConvertEncodingToIANACharSetName
(
enc
);
}
return
CFStringGetCStringPtr
(
name
,
0
);
#else
#else
int
font
,
script
,
lang
;
int
font
,
script
,
lang
;
font
=
0
;
font
=
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