mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Moved PyMac_GetScript() to _localemodule, which is the only place where
it is used, and made it private. Should fix #978662.
This commit is contained in:
parent
75694501ca
commit
59f072ad7c
3 changed files with 26 additions and 27 deletions
|
@ -27,30 +27,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "pymactoolbox.h"
|
||||
|
||||
|
||||
/*
|
||||
** Find out what the current script is.
|
||||
** Donated by Fredrik Lund.
|
||||
*/
|
||||
char *PyMac_getscript()
|
||||
{
|
||||
CFStringEncoding enc = CFStringGetSystemEncoding();
|
||||
static CFStringRef name = NULL;
|
||||
/* Return the code name for the encodings for which we have codecs. */
|
||||
switch(enc) {
|
||||
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 (char *)CFStringGetCStringPtr(name, 0);
|
||||
}
|
||||
|
||||
/* Like strerror() but for Mac OS error numbers */
|
||||
char *PyMac_StrError(int err)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue