Skip to content

Commit d2b0231

Browse files
authored
Don't define decode_locale() nor encode_locale() on macOS or Android.
1 parent 6693d7a commit d2b0231

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Python/fileutils.c

+4
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ decode_ascii_surrogateescape(const char *arg, size_t *size)
249249
}
250250
#endif
251251

252+
#if !defined(__APPLE__) && !defined(__ANDROID__)
252253
static wchar_t*
253254
decode_locale(const char* arg, size_t *size)
254255
{
@@ -364,6 +365,7 @@ decode_locale(const char* arg, size_t *size)
364365
}
365366
return NULL;
366367
}
368+
#endif
367369

368370

369371
/* Decode a byte string from the locale encoding with the
@@ -453,6 +455,7 @@ _Py_EncodeLocaleUTF8(const wchar_t *text, size_t *error_pos)
453455
return cpath;
454456
}
455457

458+
#if !defined(__APPLE__) && !defined(__ANDROID__)
456459
static char*
457460
encode_locale(const wchar_t *text, size_t *error_pos)
458461
{
@@ -516,6 +519,7 @@ encode_locale(const wchar_t *text, size_t *error_pos)
516519
}
517520
return result;
518521
}
522+
#endif
519523

520524
/* Encode a wide character string to the locale encoding with the
521525
surrogateescape error handler: surrogate characters in the range

0 commit comments

Comments
 (0)

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant