1
0
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:
Moritz Grimm 2017-07-07 18:50:24 +02:00
parent 75b6962a33
commit e3aefe825e
2 changed files with 3 additions and 17 deletions

View File

@ -106,7 +106,7 @@ dnl ## HEADERS #########################################################
dnl #############
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
@ -210,11 +210,9 @@ dnl #######################
AC_CHECK_FUNCS([ \
arc4random \
basename \
nl_langinfo \
pclose \
popen \
random \
setlocale \
srandomdev \
])

View File

@ -26,13 +26,9 @@
#include <ctype.h>
#include <errno.h>
#ifdef HAVE_LANGINFO_H
# include <langinfo.h>
#endif
#include <langinfo.h>
#include <limits.h>
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
#include <locale.h>
#include <stdio.h>
#include <string.h>
@ -90,13 +86,9 @@ CHARtoUTF8(const char *in_str, int mode)
{
char *codeset;
#if defined(HAVE_NL_LANGINFO) && defined(HAVE_SETLOCALE) && defined(CODESET)
setlocale(LC_CTYPE, "");
codeset = nl_langinfo((nl_item)CODESET);
setlocale(LC_CTYPE, "C");
#else
codeset = (char *)"";
#endif /* HAVE_NL_LANGINFO && HAVE_SETLOCALE && CODESET */
return (iconvert(in_str, codeset, "UTF-8", mode));
}
@ -106,13 +98,9 @@ UTF8toCHAR(const char *in_str, int mode)
{
char *codeset;
#if defined(HAVE_NL_LANGINFO) && defined(HAVE_SETLOCALE) && defined(CODESET)
setlocale(LC_CTYPE, "");
codeset = nl_langinfo((nl_item)CODESET);
setlocale(LC_CTYPE, "C");
#else
codeset = (char *)"";
#endif /* HAVE_NL_LANGINFO && HAVE_SETLOCALE && CODESET */
return (iconvert(in_str, "UTF-8", codeset, mode));
}