diff -r c8a7a49bab89 -r 20dd07abde5b Python/frozenmain.c --- a/Python/frozenmain.c Thu Mar 19 14:51:37 2015 -0500 +++ b/Python/frozenmain.c Thu Mar 19 15:04:40 2015 -0500 @@ -19,7 +19,9 @@ int i, n, sts = 1; int inspect = 0; int unbuffered = 0; +#ifndef __ANDROID__ char *oldloc = NULL; +#endif wchar_t **argv_copy = NULL; /* We need a second copies, as Python might modify the first one. */ wchar_t **argv_copy2 = NULL; @@ -46,6 +48,7 @@ setbuf(stderr, (char *)NULL); } +#ifndef __ANDROID__ oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL)); if (!oldloc) { fprintf(stderr, "out of memory\n"); @@ -53,6 +56,7 @@ } setlocale(LC_ALL, ""); +#endif for (i = 0; i < argc; i++) { argv_copy[i] = Py_DecodeLocale(argv[i], NULL); argv_copy2[i] = argv_copy[i]; @@ -63,9 +67,13 @@ goto error; } } +#ifdef __ANDROID__ + setlocale(LC_ALL, ""); +#else setlocale(LC_ALL, oldloc); PyMem_RawFree(oldloc); oldloc = NULL; +#endif #ifdef MS_WINDOWS PyInitFrozenExtensions(); @@ -108,6 +116,8 @@ PyMem_RawFree(argv_copy2[i]); PyMem_RawFree(argv_copy2); } +#ifndef __ANDROID__ PyMem_RawFree(oldloc); +#endif return sts; } diff -r c8a7a49bab89 -r 20dd07abde5b Python/pylifecycle.c --- a/Python/pylifecycle.c Thu Mar 19 14:51:37 2015 -0500 +++ b/Python/pylifecycle.c Thu Mar 19 15:04:40 2015 -0500 @@ -224,6 +224,10 @@ return NULL; } return get_codec_name(codeset); +#elif defined(__ANDROID__) + char* m = malloc(6); + strcpy(m, "ascii"); + return m; #else PyErr_SetNone(PyExc_NotImplementedError); return NULL;