provide file with locales and corresponding encodings

This commit is contained in:
Andrzej Rybczak
2009-03-20 20:33:35 +01:00
parent 23567ed4f1
commit b2317df843
7 changed files with 429 additions and 14 deletions

View File

@@ -20,7 +20,7 @@
#include "charset.h"
#if defined(SUPPORTED_LOCALES) && defined(HAVE_ICONV_H)
#ifdef HAVE_ICONV_H
#include <iconv.h>
#include <cstdlib>
@@ -96,10 +96,10 @@ void init_current_locale()
std::string envlocale = setlocale(LC_CTYPE, "");
if (envlocale.empty() || envlocale == "C")
return;
std::ifstream f(SUPPORTED_LOCALES);
std::ifstream f(ENCODINGS);
if (!f.is_open())
{
std::cerr << "ncmpcpp: cannot open file "SUPPORTED_LOCALES"!\n";
std::cerr << "ncmpcpp: cannot open file "ENCODINGS"!\n";
return;
}
envlocale += " ";
@@ -180,5 +180,5 @@ void str_pool_locale_to_utf(char *&s)
charset_convert(locale_charset, "utf8", s);
}
#endif // SUPPORTED_LOCALES && HAVE_ICONV_H
#endif // HAVE_ICONV_H