diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-04-06 20:21:29 +0200 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2012-05-19 01:42:53 +0200 |
commit | 2d9c0bab540274e99480d965f38f266d20097976 (patch) | |
tree | e004fcdc65cd091521ca12575b82e672cc5908e3 /firmware/common/unicode.c | |
parent | 4a6b875eda8fe7827b8a55e42e48184a6588ee4c (diff) |
Add support for cp1252 (Western European) codepage.
In Europe Windows defaults to its own codepage cp1252 (also known as "WinLatin"
or "Windows-1252"). cp1252 adds some characters to ISO-8859-1.
Some mp3 tagging software on Windows uses cp1252 instead of ISO-8859-1. This
violates the ID3 specification, which requires tags to be ISO-8859-1 or
Unicode. However, similar violations are made for other codepages and supported
by Rockbox using the "Default Codepage" setting. Add support for cp1252 to
enable people using such broken tools to override the correct decoding to get
their tags displayed properly.
Change-Id: I9f2ec478afe2503e99ee8e6609416c92b0f453e0
Reviewed-on: http://gerrit.rockbox.org/209
Reviewed-by: Jens Arnold <amiconn@rockbox.org>
Tested-by: Jens Arnold <amiconn@rockbox.org>
Diffstat (limited to 'firmware/common/unicode.c')
-rw-r--r-- | firmware/common/unicode.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/common/unicode.c b/firmware/common/unicode.c index 25d4a9129e..3ad63ee4fb 100644 --- a/firmware/common/unicode.c +++ b/firmware/common/unicode.c @@ -56,7 +56,7 @@ static const char * const filename[NUM_TABLES] = static const char cp_2_table[NUM_CODEPAGES] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 0 + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 0 }; static const char * const name_codepages[NUM_CODEPAGES+1] = @@ -70,6 +70,7 @@ static const char * const name_codepages[NUM_CODEPAGES+1] = "ISO-8859-9", "ISO-8859-2", "CP1250", + "CP1252", "SJIS", "GB-2312", "KSX-1001", @@ -80,7 +81,7 @@ static const char * const name_codepages[NUM_CODEPAGES+1] = #else /* !HAVE_LCD_BITMAP, reduced support */ -#define MAX_CP_TABLE_SIZE 640 +#define MAX_CP_TABLE_SIZE 768 #define NUM_TABLES 1 static const char * const filename[NUM_TABLES] = { @@ -89,7 +90,7 @@ static const char * const filename[NUM_TABLES] = { static const char cp_2_table[NUM_CODEPAGES] = { - 0, 1, 1, 1, 1, 1, 0 + 0, 1, 1, 1, 1, 1, 1, 0 }; static const char * const name_codepages[NUM_CODEPAGES+1] = @@ -100,6 +101,7 @@ static const char * const name_codepages[NUM_CODEPAGES+1] = "ISO-8859-9", "ISO-8859-2", "CP1250", + "CP1252", "UTF-8", "unknown" }; @@ -190,6 +192,7 @@ unsigned char* iso_decode(const unsigned char *iso, unsigned char *utf8, /* cp tells us which codepage to convert from */ switch (cp) { case ISO_8859_7: /* Greek */ + case WIN_1252: /* Western European */ case WIN_1251: /* Cyrillic */ case ISO_8859_9: /* Turkish */ case ISO_8859_2: /* Latin Extended */ |