summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-07-31 01:35:53 +0200
committerwm4 <wm4@nowhere>2012-07-31 01:35:53 +0200
commit6e020e66e0e454e8c7f1eeb17e85b90262e95386 (patch)
tree0cace859c7775e6066dbe9fcb3f742269bf84657 /osdep
parentc78ba1c55c86db4d17583f7c8eb5b9034ae98193 (diff)
downloadmpv-6e020e66e0e454e8c7f1eeb17e85b90262e95386.tar.bz2
mpv-6e020e66e0e454e8c7f1eeb17e85b90262e95386.tar.xz
mp_msg: remove filename_recode
This was intended for translating filenames from filesystem charset to the terminal charset. Modern sane platforms use UTF-8 for everything, and on Windows we use unicode APIs, so this is not needed anymore. Remove filename_recode, all uses of it, options and configure checks related to terminal output charset, and code that tries to determine the same.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/getch2-win.c40
-rw-r--r--osdep/getch2.c18
-rw-r--r--osdep/getch2.h11
3 files changed, 0 insertions, 69 deletions
diff --git a/osdep/getch2-win.c b/osdep/getch2-win.c
index f1ccea6359..de886182c9 100644
--- a/osdep/getch2-win.c
+++ b/osdep/getch2-win.c
@@ -183,43 +183,3 @@ void getch2_disable(void)
if(!getch2_status) return; // already disabled / never enabled
getch2_status=0;
}
-
-#ifdef CONFIG_ICONV
-static const struct {
- unsigned cp;
- char* alias;
-} cp_alias[] = {
- { 20127, "ASCII" },
- { 20866, "KOI8-R" },
- { 21866, "KOI8-RU" },
- { 28591, "ISO-8859-1" },
- { 28592, "ISO-8859-2" },
- { 28593, "ISO-8859-3" },
- { 28594, "ISO-8859-4" },
- { 28595, "ISO-8859-5" },
- { 28596, "ISO-8859-6" },
- { 28597, "ISO-8859-7" },
- { 28598, "ISO-8859-8" },
- { 28599, "ISO-8859-9" },
- { 28605, "ISO-8859-15" },
- { 65001, "UTF-8" },
- { 0, NULL }
-};
-
-char* get_term_charset(void)
-{
- char codepage[10];
- unsigned i, cpno = GetConsoleOutputCP();
- if (!cpno)
- cpno = GetACP();
- if (!cpno)
- return NULL;
-
- for (i = 0; cp_alias[i].cp; i++)
- if (cpno == cp_alias[i].cp)
- return strdup(cp_alias[i].alias);
-
- snprintf(codepage, sizeof(codepage), "CP%u", cpno);
- return strdup(codepage);
-}
-#endif
diff --git a/osdep/getch2.c b/osdep/getch2.c
index f0aa19a2cc..cd8a198737 100644
--- a/osdep/getch2.c
+++ b/osdep/getch2.c
@@ -50,11 +50,6 @@
#endif
#endif
-#if defined(HAVE_LANGINFO) && defined(CONFIG_ICONV)
-#include <locale.h>
-#include <langinfo.h>
-#endif
-
#include <unistd.h>
#include <fcntl.h>
@@ -325,16 +320,3 @@ void getch2_disable(void){
tcsetattr(0,TCSANOW,&tio_orig);
#endif
}
-
-#ifdef CONFIG_ICONV
-char* get_term_charset(void)
-{
- char* charset = NULL;
-#ifdef HAVE_LANGINFO
- setlocale(LC_CTYPE, "");
- charset = strdup(nl_langinfo(CODESET));
- setlocale(LC_CTYPE, "C");
-#endif
- return charset;
-}
-#endif
diff --git a/osdep/getch2.h b/osdep/getch2.h
index 4442f1181d..85899b3ce3 100644
--- a/osdep/getch2.h
+++ b/osdep/getch2.h
@@ -49,17 +49,6 @@ void getch2_disable(void);
struct mp_fifo;
bool getch2(struct mp_fifo *fifo);
-#ifdef CONFIG_ICONV
-/**
- * \brief gets the name of the system's terminal character set
- * \return a malloced string indicating the system charset
- *
- * Be warned that this function on many systems is in no way thread-safe
- * since it modifies global data
- */
-char *get_term_charset(void);
-#endif
-
#if defined(__MINGW32__)
// slave cmd function for Windows
int mp_input_slave_cmd_func(int fd,char* dest,int size);