mirror of
https://gitlab.xiph.org/xiph/ezstream.git
synced 2025-01-03 14:56:35 -05:00
Assume POSIX locale support
This commit is contained in:
parent
75b6962a33
commit
e3aefe825e
@ -106,7 +106,7 @@ dnl ## HEADERS #########################################################
|
|||||||
dnl #############
|
dnl #############
|
||||||
|
|
||||||
AC_CHECK_HEADERS([ \
|
AC_CHECK_HEADERS([ \
|
||||||
sys/time.h signal.h langinfo.h libgen.h locale.h paths.h \
|
sys/time.h libgen.h paths.h \
|
||||||
], [], [],
|
], [], [],
|
||||||
[
|
[
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
@ -210,11 +210,9 @@ dnl #######################
|
|||||||
AC_CHECK_FUNCS([ \
|
AC_CHECK_FUNCS([ \
|
||||||
arc4random \
|
arc4random \
|
||||||
basename \
|
basename \
|
||||||
nl_langinfo \
|
|
||||||
pclose \
|
pclose \
|
||||||
popen \
|
popen \
|
||||||
random \
|
random \
|
||||||
setlocale \
|
|
||||||
srandomdev \
|
srandomdev \
|
||||||
])
|
])
|
||||||
|
|
||||||
|
12
src/util.c
12
src/util.c
@ -26,13 +26,9 @@
|
|||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifdef HAVE_LANGINFO_H
|
|
||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
#endif
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#ifdef HAVE_LOCALE_H
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#endif
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -90,13 +86,9 @@ CHARtoUTF8(const char *in_str, int mode)
|
|||||||
{
|
{
|
||||||
char *codeset;
|
char *codeset;
|
||||||
|
|
||||||
#if defined(HAVE_NL_LANGINFO) && defined(HAVE_SETLOCALE) && defined(CODESET)
|
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
codeset = nl_langinfo((nl_item)CODESET);
|
codeset = nl_langinfo((nl_item)CODESET);
|
||||||
setlocale(LC_CTYPE, "C");
|
setlocale(LC_CTYPE, "C");
|
||||||
#else
|
|
||||||
codeset = (char *)"";
|
|
||||||
#endif /* HAVE_NL_LANGINFO && HAVE_SETLOCALE && CODESET */
|
|
||||||
|
|
||||||
return (iconvert(in_str, codeset, "UTF-8", mode));
|
return (iconvert(in_str, codeset, "UTF-8", mode));
|
||||||
}
|
}
|
||||||
@ -106,13 +98,9 @@ UTF8toCHAR(const char *in_str, int mode)
|
|||||||
{
|
{
|
||||||
char *codeset;
|
char *codeset;
|
||||||
|
|
||||||
#if defined(HAVE_NL_LANGINFO) && defined(HAVE_SETLOCALE) && defined(CODESET)
|
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
codeset = nl_langinfo((nl_item)CODESET);
|
codeset = nl_langinfo((nl_item)CODESET);
|
||||||
setlocale(LC_CTYPE, "C");
|
setlocale(LC_CTYPE, "C");
|
||||||
#else
|
|
||||||
codeset = (char *)"";
|
|
||||||
#endif /* HAVE_NL_LANGINFO && HAVE_SETLOCALE && CODESET */
|
|
||||||
|
|
||||||
return (iconvert(in_str, "UTF-8", codeset, mode));
|
return (iconvert(in_str, "UTF-8", codeset, mode));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user