diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2014-02-07 16:53:27 +0100 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2014-02-23 20:23:52 +0100 |
| commit | 07f484824cd5c095e0e76e9a7e2db9d7bbdd55c7 (patch) | |
| tree | 1bc95af737c31a8e30d63e9533a9afebc4794229 /firmware/common | |
| parent | facbaab1953f9ab355fb3a3259dc0acbaabd9cc5 (diff) | |
| download | rockbox-07f484824cd5c095e0e76e9a7e2db9d7bbdd55c7.zip rockbox-07f484824cd5c095e0e76e9a7e2db9d7bbdd55c7.tar.gz rockbox-07f484824cd5c095e0e76e9a7e2db9d7bbdd55c7.tar.bz2 rockbox-07f484824cd5c095e0e76e9a7e2db9d7bbdd55c7.tar.xz | |
codepages: Translate to linux codepage names for use on APPLICATION.
The iocharset mount option names the codepages slightly differently and
must be translated properly.
Change-Id: I147a256e3453136282244201c27225a30cdfdca0
Diffstat (limited to 'firmware/common')
| -rw-r--r-- | firmware/common/unicode.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/firmware/common/unicode.c b/firmware/common/unicode.c index 3ad63ee..2bb7bfb 100644 --- a/firmware/common/unicode.c +++ b/firmware/common/unicode.c @@ -79,6 +79,35 @@ static const char * const name_codepages[NUM_CODEPAGES+1] = "unknown" }; +#if defined(APPLICATION) && defined(__linux__) +static const char * const name_codepages_linux[NUM_CODEPAGES+1] = +{ + "iso8859-1", + "iso8859-7", + "iso8859-8", + "cp1251", + "iso8859-11", + "cp1256", + "iso8859-9", + "iso8859-2", + "cp1250", + "iso8859-15" /* closest, linux doesnt have a codepage named cp1252 */ + "cp932", + "cp936", + "cp949", + "cp950", + "utf8", + "cp437" +}; + +const char *get_current_codepage_name_linux(void) +{ + if (default_codepage < 0 || default_codepage >= NUM_CODEPAGES) + return name_codepages_linux[NUM_CODEPAGES]; + return name_codepages_linux[default_codepage]; +} +#endif + #else /* !HAVE_LCD_BITMAP, reduced support */ #define MAX_CP_TABLE_SIZE 768 |