mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 17:39:38 +00:00
libarchive: add fallback for systems without C.UTF-8
This commit is contained in:
parent
dcb7838bb7
commit
037cbacb8c
@ -196,6 +196,7 @@ int msync(void *addr, size_t length, int flags);
|
||||
// These are stubs since there is not anything that helps with this on Windows.
|
||||
#define locale_t int
|
||||
#define LC_ALL_MASK 0
|
||||
#define LC_CTYPE_MASK 0
|
||||
locale_t newlocale(int, const char *, locale_t);
|
||||
locale_t uselocale(locale_t);
|
||||
void freelocale(locale_t);
|
||||
|
@ -244,8 +244,11 @@ struct mp_archive *mp_archive_new(struct mp_log *log, struct stream *src,
|
||||
struct mp_archive *mpa = talloc_zero(NULL, struct mp_archive);
|
||||
mpa->log = log;
|
||||
mpa->locale = newlocale(LC_ALL_MASK, "C.UTF-8", (locale_t)0);
|
||||
if (!mpa->locale)
|
||||
goto err;
|
||||
if (!mpa->locale) {
|
||||
mpa->locale = newlocale(LC_CTYPE_MASK, "", (locale_t)0);
|
||||
if (!mpa->locale)
|
||||
goto err;
|
||||
}
|
||||
mpa->arch = archive_read_new();
|
||||
mpa->primary_src = src;
|
||||
if (!mpa->arch)
|
||||
|
Loading…
Reference in New Issue
Block a user